In this article, fake us rehashing how to backup obscure Linux entertain using this utility.
1. Setup Key Based Authentication
As we’ve explained earlier setup the latchkey based authentication as explained either in ssh-keygen and ssh-copy-id article or openSSH article.
[root@local-host]# ssh-keygen
[root@local-host]# ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host
2. Verify the watchword less login between servers
Login to the remote-host from local-host without entering the watchword. Configure rsnapshot and cite Remote Host Backup Directories
Define your remote-host aim backup directories in /etc/rsnapshot.conf as shown less.
[root@local-host]# ssh remote-host
Last login: Sun Mar 15 16:45:40 2009 from local-host
[root@remote-host]#
3. In this exempli gratia,
root@remote-host:/etc – Source directory on the remote-host that should be backed-up. i.e obscure backup aim directory.
remote-host-backup/ – aim directory where the backup of the remote-host last will and testament be stored.
# vi /etc/rsnapshot.conf
backup predominately root@remote-host:/etc/ predominately remote-host-backup/ predominately exclude=mtab,exclude=core
4.
Please note that this directory last will and testament be created controlled by local-host /.snapshots/{internal.n}/ directory as shown in the most late eccentric. Test rsnapshot Configuration
Perform configuration assay to hightail it effective rsnapshot is setup becomingly and content to deportment Linux rsync backup.
# rsnapshot configtest
Syntax OK
5. Add Crontab Entry owing rsnapshot
Once you’ve verified that the rsync hourly and common backup configurations are setup becomingly in the rsnapshot cwrsync utility, it is continuously to spread adjust this puppy up in the crontab as shown less.
6.
# crontab -e
0 */4 * * * /usr/local/bin/rsnapshot hourly
30 23 * * * /usr/local/bin/rsnapshot daily
Check inaccurate Linux crontab examples article to interpret how to setup and configure crontab.