I have been using rsync to copy files for some time. My understanding is that rsync is faster than cp when some of the files to transfer are already in the destination directory, transferring only the incremental difference (i.e. the "deltas").
If this is correct, would there be any advantage to using rsync to moving the contents of a folder A, to say, a folder B, with B being empty?
The folder A has close to 1TB of data (and millions of files in it). The transfer would be done over a local network (A and B being on different filesystems, both mounted on a supercomputer, e.g. A is NFS and B is lustre).
Aside from that, what flags should I use to ask rsync to move (not copy) files from A to B (i.e. to delete A when the transfer has successfully finished)?
rsynccan replacemv. I would expectmvto be faster on most file system types when the source and destination are within the same file system, becausersyncwould have to make a copy no matter what, andmvcould probably get away with changing a few directory entries. The closest thing I can find to anrsync mvis the--remove-source-filescommand, but that does not remove directories. – jw013 Jul 25 '12 at 17:19mvfaster? – Amelio Vazquez-Reina Jul 25 '12 at 17:22mvcan't operate across a network - it would have to rely a local mount (e.g. NFS). If the bottleneck is the network,rsyncwould probably be faster thanmvbecausersynccan do compression. – jw013 Jul 25 '12 at 17:25cphas-uoption to copy source file if it is newer than the destination file or when the destination file is missing – rush Jul 25 '12 at 17:38