Tuesday 8 September, 2009

rsnapshot with rsync howto on Fedora

rsnapshot with rsync howto on Fedora
Simple yet Powerfull for incremental backup.


Required packages,
Rsync
rsnapshot

You can do it for remote servers also.
I have configure it for local files only.
#yum install rsnapshot rsync -y

created backup_root /backup/
mkdir /backup/
Off course it has to be on diffrent hard disk as we are taking backup.
But I created on local disk for testing.

#vim /etc/rsnapshot.conf

Set snapshots root directory:
 snapshot_root	/disk1/backup/ 
Configure backup policy
interval hourly 6       # run 6 times a day means every 4 hour 
interval daily 7        # and everyday and keep for 7 days.
#interval weekly 4
#interval monthly 3

I set it for hourly and weekly only.

Specify local and remote backup directories
Find out comments that read as follows:

 ############################### ### BACKUP POINTS / SCRIPTS ### ############################### 

backup /etc/ localhost/
#backup /usr/local/ localhost/
backup /var/log/ localhost/

Save and close the file.



 Test your config file for errors 
Type the following to test your configuration file for errors
# rsnapshot configtest
Output:

 Syntax OK 

You can also run rsnapshot in a test mode to display its action:
# rsnapshot -t hourly

Run rsnapshot for first time

To run first time, enter:
# rsnapshot hourly


Configure cron job
Edit /etc/cron.d/rsnapshot file to setup backup snapshot job. This is a sample cron file for rsnapshot. The values used correspond to the examples in /etc/rsnapshot.conf. There you can also set the backup points and many other things. To activate this cron file you have to uncomment the lines below.
Feel free to adapt it to your needs.

 0 */4         * * *           root    /usr/bin/rsnapshot hourly 30 3          * * *           root    /usr/bin/rsnapshot daily 0  3          * * 1           root    /usr/bin/rsnapshot weekly 30 2          1 * *           root    /usr/bin/rsnapshot monthly    सुखदेव सोपान जाधव  Sukhdev Sopan Jadhav   "मौसम के साथ साथ बदल जाना चाहिये| खुशीयाँ न हो तो फीर गम से बहल जाना चाहीये|  जीस रौशनी से आँखे खूल न सके | उस रौशनी से दूर निकल जाना चाहिये |" - अब्बास दाना बडौदी |