Computerglitch

An ongoing adventure

Creating a Backup Server Using Rsnapshot

This is from my experience of setting up a Debian Linux box to syncronize via smbmount with shares on a remote Windows 2000 Server every two hours using rsnapshot.


First be sure you have samba along with smbfs installed so we can mount the remote windows shares:

# dpkg -l | grep samba
# dpkg -l | grep smbfs

Once it is verified these packages are installed, install the rsnapshot package. With Debian it’s as easy as:

# apt-get install rsnapshot 

Next create a directory on the local Debian box to hold snapshots of the remote Windows share:

# mkdir /winback/snapshots 

Next create a directory in /mnt with the name of the remote Windows 2000 share:

# mkdir /mnt/sharename 

Next mount the remote Windows 2000 share from the Debian box using the Windows 2000 box’s IP Address:

# smbmount //ip-address/sharename /mnt/sharename/ -o \ username=windows-username,password=windows-password rw 

Now edit the settings in /etc/rsnapshot.conf with your favorite editor:

# All snapshots will be stored under this root directory.
snapshot_root /winback/snapshots/

# Backup Intervals
interval hourly 12
Note: 12 sets to sync every 2 hours, 6 sets to sync every 4 hours, etc.

# BACKUP POINTS / SCRIPTS
# LOCALHOST
backup /mnt/sharename windows-server-name/

Next run rsnapshot configtest to be sure rsnapshot.conf is valid

# rsnapshot configtest
Syntax OK

Finally set crontab to run the sync every 2 hours:

# crontab -e
0 */2 * * * /usr/bin/rsnapshot hourly

Comments