I recently setup A Centos 5.3 box to backup a handful of windows machines and a boat load of Freebsd servers. If someone finds this guide useful…great. If not, well tough. My disclaimer: I take no responsibility for what anyone manages to do with this guide.
I’m assuming the Centos box is all installed. I went with a clean install of Centos 5.3, using the basic Gui-less server packages. I named the box BACKUP. Also, I didn’t want rsnapshot running as root so it’s setup to work as the rsync user. I’m also installing webmin and samba for some remote access. Enjoy.
Add BACKUP to networks
setup
Go to Network Configuration
Add in static IP addresses
service network restart
This should set your box with the static address.
Set Time
date
Confirm date is correct. If not…
date nnddhhmmyyyy
Thats MonthDayHourMinuteYear
Add Rsync User
/usr/sbin/useradd rsync
passwd SomeGoodPassword
Add an Rsync user to every linux/unix computer that you’re going to be backing up.
Install Rsync on every Linux/Unix machine that you want to backup.
For FreeBSD Machines:
/usr/ports/net/rsync
Make install clean
Install RSnapshot
Centos:
Mkdir /download
Cd /download
wget http://www.rsnapshot.org/downloads/rsnapshot-1.3.0-1.noarch.rpm
rpm -ivh rsnapshot-1.3.0-1.noarch.rpm
Create Password-less SSH Login for RSync User
Login as Rsync User
ssh-keygen -t rsa
default options no passphrase
To add a FreeBSD Machine:
scp /home/rsync/.ssh/id_rsa.pub rsync@remotehost.com:~/.ssh/authorized_keys
To A Centos Machine:
scp /home/rsync/.ssh/id_rsa.pub rsync@remotehost.com:~/.ssh/authorized_keys2
(If you get a permission error log into the remotehost and create the .ssh folder under the rsync user’s home directory.)
For adding windows machine allow me to direct you to this great cwrsync tutorial.
Using Rsnapshot to Backup Windows Machines
Change Permissions
chgrp rsync /var/log/rsnapshot
chown rsync /var/log/rsnapshot
mkdir /.snapshots/
chgrp rsync /.snapshots/
chown rsync /.snapshots/
mkdir /var/run/rsnapshot/
chgrp rsync /var/run/rsnapshot/
chown rsync /var/run/rsnapshot/
Change Rsnapshot.conf
I change the lockfile location to a folder that is owned by the rsync user so I don’t get permission issues when I run the command.
Nano rsnapshot.conf
Uncomment: cmd_rsync /usr/bin/rsync
Change:
Lockfile /var/run/rsnapshot.pid
To
Lockfile /var/run/rsnapshot/rsnapshot.pid
Add Rsnapshot Entries
Nano rsnapshot.conf
Examples Entires (note everything is tab spaced)
For interval
interval daily 7
interval weekly 4
interval monthly 3
#Example entry for a FreeBSD machine-this backs up the /home/all/ folder and puts it undr a machine.com folder when backed # up. Make sure the rsync user has access to that folder.
backup rsync@machine.com:/home/all/ machine.com
#Example entry for a windows machine
backup windows.machine.com::AShare windows.machine.com/Share
Add Cron
Nano /etc/cron.d/rsnapshot
50 23 * * * /usr/bin/rsnapshot daily
40 23 * * 6 /usr/bin/rsnapshot weekly
30 23 1 * * /usr/bin/rsnapshot monthly
This can also be tweaked in the web admin installed later.
Test Rsnapshot
Test by logging in as rsync user
Rsnapshot daily
Daily.0 should be created in the /.snapshot folder. It should have completely backed up all the desired folders.
Install Webmin
cd /download
wget http://superb-east.dl.sourceforge.net/sourceforge/webadmin/webmin-1.380-1.noarch.rpm rpm -i webmin-1.380-1.noarch.rpm
Add it to Centos Firewall
setup
Go to Firewall Configuration
Add port 10000
quit
service iptables restart
Login to Webmin
https://BackupMachine.com:10000
I want my freebsd machines to backup their databases so I can hopy them over.
Start Mysql Database Backups on Client Machines using Webmin.
In webmin
Server->Mysql->Backup
Set Backups to run automatically.
Configure for the /mysqlbackup folder.
chown rsync /mysqlbackup
chgrp rsync /mysqlbckup
Enable Samba
Enable Samba in Webmin
Edit smb.conf
Add Modules (This is pretty obvious. There are a thousand and one Samba tutorials)
Restart Samba Service
Add Users
Smbpasswd NameOfCurrentUser
Add that linux user rsync group
And done. With this you can backup every day (or whenever. Hourly?) databases, windows computer, normal files, and whatever else. You can monitor the server via webmin and check the backups through the samba share. However. Have fun!
Also: for more information. Try this guide.

Turns out many online products are not really creditable the buy. the only thing left on the web that is not abused is knowledge we could pass from 1 to another. great going with this post, for real