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 [2020/01/27 20:08] – oemb1905 | computing:rsyncrsnapshot [2023/04/10 21:03] – oemb1905 | ||
---|---|---|---|
Line 7: | Line 7: | ||
------------------------------------------- | ------------------------------------------- | ||
- | Let's start with rsnapshot. | + | 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 | ||
+ | # | ||
+ | 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' | ||
+ | |||
+ | # | ||
+ | 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 | sudo apt install rsnapshot | ||
Line 23: | Line 80: | ||
<backup /etc/ localhost> | <backup /etc/ localhost> | ||
- | Now, edit the default script inside '' | + | Now, edit the default script inside '' |
<0 */4 * * * root / | <0 */4 * * * root / | ||
Line 55: | Line 112: | ||
sudo rsync -avi --delete / | sudo rsync -avi --delete / | ||
- | | + | |
- | Enjoy. | + | Once you master these steps, checkout remote-upgrades, |
This tutorial is a designated " | This tutorial is a designated " |