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 [2023/04/10 20:57] – oemb1905 | computing:rsyncrsnapshot [2023/04/10 21:12] – oemb1905 | ||
---|---|---|---|
Line 7: | Line 7: | ||
------------------------------------------- | ------------------------------------------- | ||
- | 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 ''/ | + | 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 | #base config | ||
Line 30: | Line 30: | ||
backup | backup | ||
| | ||
- | Then, to run this, I use a simple script I created. | + | Then, to run this, I use a simple script I created. |
+ | |||
+ | # | ||
+ | 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 | ||
+ | |||
+ | Then, in ''/ | ||
+ | |||
+ | 0 0,14 * * * root /bin/bash / | ||
+ | |||
+ | Now that the localhost/ | ||
+ | |||
+ | #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 | ||
+ | # | ||
+ | backup | ||
+ | backup | ||
+ | backup | ||
+ | backup | ||
+ | backup | ||
+ | |||
+ | Now that the config is setup, you use a script very similar to the localhost script above, but note the syntax changes for sync and alpha that will specify to rsnapshot to use this particular configuration file: | ||
+ | |||
+ | |||
+ | |||