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)?
rsync
can replacemv
. I would expectmv
to be faster on most file system types when the source and destination are within the same file system, becausersync
would have to make a copy no matter what, andmv
could probably get away with changing a few directory entries. The closest thing I can find to anrsync mv
is the--remove-source-files
command, but that does not remove directories.mv
faster?mv
can't operate across a network - it would have to rely a local mount (e.g. NFS). If the bottleneck is the network,rsync
would probably be faster thanmv
becausersync
can do compression.cp
has-u
option to copy source file if it is newer than the destination file or when the destination file is missing