This is an old revision of the document!
sudo rsync -avxHAX --progress --delete /sourcefiles/path /backup/path
Adding h, H, P, will preserve hard links, give you human readable output, and show the progress (eliminating the need for –progress).
sudo rsync -avxHAXhHP --delete /sourcefiles/path /backup/path
Cloning entire drives, use:
sudo rsync -avxHAXhHP --delete /sourcefiles/path /backup/path --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}
If the drive you are cloning from has a different filesystem than the destination drive, you can remove the exclusions as -x will handle those exclusions in that case. After cloning, you will need to adjust fstab on the destination partition:
cd /etc/ sudo nano fstab <Edit the drive UUID of the new destination drive>
Now, make the destination volume bootable:
grub-install /dev/sdX
If you are using this method to clone your existing server to another hard drive on the same host, then make sure to run grub-update on the primary OS. After you do that, both the kernels for the primary OS and the cloned OS will appear in GRUB, and you can boot into the clone, specifically, to make sure that everything migrated properly and is in working order. It is not sufficient to simply run rsync and hope that all went well.
rsync over ssh
rsync -avxHAXhHP --delete 'ssh -p 53333' 'user@remotemachine:/home/user/*.zip' /path/to/dir/on/localhost
— oemb1905 2018/11/22 12:56