I need to copy a directory from one place to another. OK - I guess I could live with that if that's the way it has to be.
I want all the files, both in the source and the destination, to have the Access, Modify, and Change timestamps they had before I began the copy. The directory has 3 million files spread out over tens of thousands of subdirectories going 20 levels deep, so anything that handles files individually is not practical. Your post seems more to be about just how to mirror data or something right? But it also changes the access timestamp at the destination.
rsync is a fast and extraordinarily versatile file copying tool.
It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon.
Welcome to Linux Questions.org, a friendly and active Linux Community. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration.
Note that registered members see fewer ads, and Content Link is completely disabled once you log in. Visit the following links: Site Howto | Site FAQ | Sitemap | Register Now If you have any problems with the registration process or your account login, please contact us. This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
I've found that cp, rsync, and tar each offer options that preserve some of the timestamps, but I can't find a way to preserve all of them. The directory has 3 million files spread out over tens of thousands of subdirectories going 20 levels deep, so anything that handles files individually is not practical. So, there are only a few layers in the storage stack to begin with, and you need to chose where you'll copy: block level? If I use cp -p, it won't change the access timestamp at the destination, but it changes it at the source. tar -C work/ -cf - | ssh hpmedia 'tar -C rsynctest -xvf - home.png' ssh hpmedia stat rsynctest/File: `rsynctest/home.png' Size: 4624 Blocks: 24 IO Block: 4096 regular file Device: 831h/2097d Inode: 7676168 Links: 1 Access: (0640/-rw-r-----) Uid: ( 1000/jschiwal) Gid: ( 1000/jschiwal) Access: 2009-07-27 .000000000 -0500 Modify: 2009-07-27 .000000000 -0500 Change: 2009-07-27 .000000000 -0500 [email protected]:~ stat work/File: `work/home.png' Size: 4624 Blocks: 16 IO Block: 4096 regular file Device: 807h/2055d Inode: 1114126 Links: 1 Access: (0640/-rw-r-----) Uid: ( 1000/jschiwal) Gid: ( 1000/jschiwal) Access: 2009-07-27 .000000000 -0500 Modify: 2009-07-27 .000000000 -0500 Change: 2009-07-27 .000000000 -0500Just out of curiosity, why are you so concerned about change time?
It is related to the inode and it is transparent to many commands, which on the contrary refer to the modification and/or the access time to work properly.Update: And which OS are you running BC4 beta on, and the source side?Hello, That option should only cover the Creation Date timestamp, and not effect the Last Modified timestamp.It offers a large number of options that control every aspect of its behavior and permit very flexible specification of the set of files to be copied.It is famous for its delta-transfer algorithm, which reduces the amount of data sent over the network by sending only the differences between the source files and the existing files in the destination. Please visit this page to clear all LQ-related cookies.