User Tools

Site Tools


computing:rsyncrsnapshot

This is an old revision of the document!



  • rsyncrsnapshot
  • Jonathan Haack
  • Haack's Networking
  • netcmnd@jonathanhaack.com

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

sudo rsync -avHe --delete -e 'ssh -p 53213' sexa@172.39.58.38:/home/Archives/ .

That last one works perfectly …

https://opensource.com/article/17/1/rsync-backup-linux https://github.com/opensourceway/rsync-backup-script https://gist.github.com/enoch85/45eba73c49f760905bc2

This tutorial is a designated “Invariant Section” of the “Technotronic” section of Haack's Wiki as described on the Start Page.

oemb1905 2018/11/22 12:56

computing/rsyncrsnapshot.1547407665.txt.gz · Last modified: 2019/01/13 19:27 by oemb1905