Copying files with rsync

rsync is used to sync/copy files. If files are already present on destination, it will not copy files again, only changed or new files get copied when you run rsync.

To Copy files on same computer

rsync -a /path/to/source/ /path/to/destination/

To copy files from one server to another, run

rsync -avz --progress "-e ssh -p 3333" /home/solusvm/ root@

Copying files from remote server to local

rsync -chavzP --stats suneesh@ /home/suneesh/www/

Rsync with exclude option

rsync -avz --delete  "-e ssh -p 3333" --exclude={dn,backup,delete} /home/

In the above example, folders dn, backup and delete will be ignored.

Posted in Linux