Copy or rsync command
Rsync is better since it will only copy only the updated parts of the updated file, instead of the whole file. It also uses compression and encryption if you want. Check out this tutorial.
Rsync is better since it will only copy only the updated parts of the updated file, instead of the whole file. It also uses compression and encryption if you want. Check out this tutorial.
There is a flag –files-from that does exactly what you want. From man rsync: –files-from=FILE Using this option allows you to specify the exact list of files to transfer (as read from the specified FILE or – for standard input). It also tweaks the default behavior of rsync to make transferring just the specified files … Read more
There are several ways rsync compares files — the authoritative source is the rsync algorithm description: https://www.andrew.cmu.edu/course/15-749/READINGS/required/cas/tridgell96.pdf. The wikipedia article on rsync is also very good. For local files, rsync compares metadata and if it looks like it doesn’t need to copy the file because size and timestamp match between source and destination it doesn’t … Read more
rsync interprets a directory with no trailing slash as copy this directory, and a directory with a trailing slash as copy the contents of this directory. Try rsync -av ~/foo/ user@remote.com:/var/www/bar/
If you have more than the last leaf directory to be created, you can either run a separate ssh … mkdir -p first, or use the –rsync-path trick as explained here : rsync -a –rsync-path=”mkdir -p /tmp/x/y/z/ && rsync” $source user@remote:/tmp/x/y/z/ Or use the –relative option as suggested by Tony. In that case, you only … Read more
If /foo/bar is on NFS (or possibly some FUSE filesystem), that might be the problem. Either way, adding -O / –omit-dir-times to your command line will avoid it trying to set modification times on directories.
The major difference between these tools is how they copy files. scp basically reads the source file and writes it to the destination. It performs a plain linear copy, locally, or over a network. rsync also copies files locally or over a network. But it employs a special delta transfer algorithm and a few optimizations … Read more