User Tools

Site Tools


computing:rsyncrsnapshot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
computing:rsyncrsnapshot [2019/01/13 19:27] oemb1905computing:rsyncrsnapshot [2020/01/27 19:55] oemb1905
Line 7: Line 7:
 ------------------------------------------- -------------------------------------------
  
-  sudo rsync -avxHAX --progress --delete /sourcefiles/path /backup/path+Let's start with rsnapshot.  Before you begin, you must already know how to add a hard drive to your system, a mount point, and an appropriate fstab entry.  To create a basic configuration, do the following:
  
-Adding //h//, //H//, //P//, will preserve hard links, give you human readable output, and show the progress (eliminating the need for --progress).+  sudo apt install rsnapshot 
 +  nano /etc/rsnapshot.conf 
 +  <rsnapshot_root /enter-mount-point-here>
  
-  sudo rsync -avxHAXhHP --delete /sourcefiles/path /backup/path +Uncomment the alpha, beta, gamma, and delta sections under //backup levels// section, enable the sync-first option, and specify the directories you want to backup (remember, ''localhost''calls whatever you have above in ''rsnapshot_root'' from above):
-   +
-Cloning entire drivesuse:+
  
-  sudo rsync -avxHAXhHP --delete /sourcefiles/path /backup/path --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found} +  <retain  alpha   6> 
-   +  <retain  beta    7> 
-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:+  <retain  gamma   4> 
 +  <retain  delta   3> 
 +  <sync_first      1> 
 +  <backup /home  localhost> 
 +  <backup /etc   localhost>
  
-  cd /etc/ 
-  sudo nano fstab 
-  <Edit the drive UUID of the new destination drive> 
-   
-Now, make the destination volume bootable: 
  
-  grub-install /dev/sdX+ 
 + 
 +Making an rsync over ssh mirror using alternate port and the old syntax. 
 + 
 +From remote server to target backup localhost: 
 + 
 +  rsync -av --delete -e 'ssh -p 59333 -i /home/user/.ssh/id_rsa' user@10.8.9.3:/home/user/Server/ /home/user/Server/ 
 + 
 +From localhost to target remote backup server:  
 + 
 +  rsync -av --delete -e 'ssh -p 59333 -i /home/user/.ssh/id_rsa' /home/user/Server/ user@10.8.9.3:/home/user/Server/
      
-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+Using the more modern syntax and no alternate port, we have:
  
-  sudo rsync -avHe --delete -e 'ssh -p 53213' sexa@172.39.58.38:/home/Archives/ . +From remote server to target backup localhost: 
-   + 
-That last one works perfectly ...+  sudo rsync -avi --delete root@server.com:/home/location/of/mysqldump.sql /home/user/backup/of/mysqldump.sql  
 + 
 +From localhost to target remote backup server:  
 + 
 +  sudo rsync -avi --delete /home/user/backup/of/mysqldump.sql root@server.com:/home/location/of/mysqldump.sql
      
-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 [[https://jonathanhaack.com/dokuwiki/doku.php?id=start|Start Page]]. 
  
- --- //[[netcmnd@jonathanhaack.com|oemb1905]] 2018/11/22 12:56//+This tutorial is a designated "Invariant Section" of the "Technotronic" section of Haack's Wiki as described on the [[https://jonathanhaack.com/dokuwiki/doku.php?id=start|Start Page]].
  
 + --- //[[oemb1905@jonathanhaack.com|oemb1905]] 2019/07/31 09:53//
      
computing/rsyncrsnapshot.txt · Last modified: 2023/04/10 21:29 by oemb1905