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 [2018/08/08 18:50] – oemb1905 | computing:rsyncrsnapshot [2023/04/10 21:03] – 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 '' |
+ | #base config | ||
+ | config_version | ||
+ | snapshot_root | ||
+ | cmd_cp | ||
+ | cmd_rm | ||
+ | cmd_rsync | ||
+ | cmd_ssh | ||
+ | cmd_logger | ||
+ | verbose | ||
+ | loglevel | ||
+ | logfile | ||
+ | sync_first | ||
+ | use_lazy_deletes | ||
+ | retain | ||
+ | #localhost | ||
+ | backup | ||
+ | backup | ||
+ | backup | ||
+ | backup | ||
+ | backup | ||
+ | | ||
+ | Then, to run this, I use a simple script I created. Again, this script is just for running the localhost, so it can also be used for someone' | ||
+ | |||
+ | #!/bin/bash | ||
+ | service="/ | ||
+ | logfile="/ | ||
+ | START1=" | ||
+ | touch $logfile | ||
+ | $service -V sync > $logfile | ||
+ | END1=" | ||
+ | DURATION1=$[ ${END1} - ${START1} ] | ||
+ | MINUTES=$[ ${DURATION1} / 60 ] | ||
+ | sed -i " | ||
+ | if | ||
+ | tail -n -5 $logfile | grep " | ||
+ | then | ||
+ | START1=" | ||
+ | echo " | ||
+ | $service -V alpha >> $logfile | ||
+ | END1=" | ||
+ | DURATION1=$[ ${END1} - ${START1} ] | ||
+ | MINUTES=$[ ${DURATION1} / 60 ] | ||
+ | sed -i " | ||
+ | mail -s " | ||
+ | rm $logfile | ||
+ | chown sexa:sexa -R / | ||
+ | chmod 770 -R / | ||
+ | else | ||
+ | echo " | ||
+ | mail -s " | ||
+ | rm $logfile | ||
+ | fi | ||
+ | |||
+ | |||
+ | |||
+ | [BEGIN OLD] Let's start with rsnapshot. | ||
+ | |||
+ | sudo apt install rsnapshot | ||
+ | nano / | ||
+ | < | ||
+ | |||
+ | 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 / | ||
+ | <30 3 * * * root / | ||
+ | <0 3 * * 1 root / | ||
+ | <30 2 1 * * root / | ||
+ | | ||
+ | Personally, I use a simple script to ensure that the sync_first command completed before I run any of the '' | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | Of course, I have one of these for alpha, another for beta, and gamma, and so on until delta. | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | OK ... that's pretty much it for getting started with rsnapshot. | ||
+ | |||
+ | From remote server to target backup localhost, with alt port: | ||
+ | |||
+ | 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 / | ||
+ | |||
+ | From remote server to target backup localhost, with standard port: | ||
+ | |||
+ | sudo rsync -avi --delete root@server.com:/ | ||
+ | |||
+ | 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 " | ||
+ | |||
+ | --- // | ||
+ | |