This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
computing:rsyncrsnapshot [2019/04/10 01:30] – oemb1905 | computing:rsyncrsnapshot [2023/04/10 20:57] – oemb1905 | ||
---|---|---|---|
Line 7: | Line 7: | ||
------------------------------------------- | ------------------------------------------- | ||
- | sudo rsync -avxHAX --progress --delete | + | Since I am backing up multiple remote hosts, I chose to create separate configs for each remote host instead of putting those destinations in the '' |
- | Adding | + | #base config |
- | + | config_version | |
- | | + | snapshot_root |
+ | cmd_cp | ||
+ | cmd_rm | ||
+ | cmd_rsync | ||
+ | cmd_ssh | ||
+ | cmd_logger | ||
+ | verbose | ||
+ | loglevel | ||
+ | logfile | ||
+ | | ||
+ | | ||
+ | retain | ||
+ | # | ||
+ | backup | ||
+ | | ||
+ | backup | ||
+ | backup | ||
+ | backup | ||
| | ||
- | Cloning entire drives, use: | + | Then, to run this, I use a simple script I created. |
- | sudo rsync -avxHAXhHP --delete / | ||
- | | ||
- | 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/ | + | [BEGIN OLD] Let's start with rsnapshot. |
- | sudo nano fstab | + | |
- | <Edit the drive UUID of the new destination drive> | + | |
- | + | ||
- | Now, make the destination volume bootable: | + | |
- | | + | |
- | | + | nano /etc/rsnapshot.conf |
- | 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, | + | |
- | rsync over ssh | + | 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, '' |
- | | + | |
- | | + | < |
+ | < | ||
+ | < | ||
+ | < | ||
+ | <backup / | ||
+ | <backup /etc/ localhost> | ||
+ | |||
+ | Now, edit the default script inside | ||
+ | |||
+ | <0 */4 * * * root | ||
+ | | ||
+ | <0 3 * * 1 root | ||
+ | <30 2 1 * * root | ||
| | ||
- | That last one works perfectly ... but no matter what, I was having | + | Personally, I use a simple script to ensure that the sync_first command completed before I run any of the '' |
- | Executed on the target backup machine, pulling from source to target | + | [[https:// |
- | rsync -avWeqr --delete -e 'ssh -p 59333 -i /home/user/.ssh/id_rsa' | + | Of course, I have one of these for alpha, another for beta, and gamma, and so on until delta. Each of these checks the verbose log for successful completion and emails me upon verification of that from the output of the '' |
- | Executed on the source machine, sending from source to target | + | [[https:// |
- | rsync -avWeqr --delete -e 'ssh -p 59333 -i /home/user/.ssh/ | + | OK ... that's pretty much it for getting started with rsnapshot. |
- | + | ||
- | https:// | + | |
- | https:// | + | |
- | https:// | + | |
- | This tutorial is a designated " | + | From remote server to target backup localhost, with alt port: |
- | --- //[[netcmnd@jonathanhaack.com|oemb1905]] 2019/04/09 19:26// | + | rsync -av --delete -e 'ssh -p 59333 -i / |
+ | |||
+ | From localhost to target remote backup server, with alt port: | ||
+ | |||
+ | rsync -av --delete -e 'ssh -p 59333 -i /home/user/ | ||
+ | |||
+ | From remote server to target backup localhost, with standard port: | ||
+ | |||
+ | sudo rsync -avi --delete root@server.com:/home/location/ | ||
+ | |||
+ | From localhost to target remote backup server, with standard port: | ||
+ | |||
+ | sudo rsync -avi --delete | ||
+ | |||
+ | Once you master these steps, checkout remote-upgrades, | ||
+ | |||
+ | This tutorial is a designated " | ||
+ | --- // | ||
| |