Hi
For those who might be interested we have created a script that does :
- Structure only backups
- rotation
The script use rsnapshot and backup all you need (you can set what you want to be backuped)
-
All rsync with rsnaphot are done under a data/fs directory
reWe also use a exlude_file listing to exclude some dir/files
-
All iworx backup structure only are done under a structrure/IP directory (IP of the domain, it will help for restoring account)
-
All mysql are done under the data/mysql/ directory
By default we set ? 2 days rotation, 1 week, 1 month
here is our rsnaphot conf file
# LOCALHOST
backup_script /root/scripts/backupv3/so_backup.sh structure/ ([B]see[/B] 1- backup_script /root/scripts/backupv3/so_backup.sh structure/)
backup /chroot/home/ data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup /etc/passwd data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup /etc/group data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup /etc/shadow data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup /etc/hosts.allow data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup /etc/hosts.deny data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup /etc/resolv.conf data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup /etc/hosts data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup /etc/proftpd.conf data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup /etc/httpd/conf/ data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup /etc/httpd/conf.d/ data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup /root/ data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup /var/spool/cron/ data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup /usr/src/redhat/RPMS/ data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup /usr/src/redhat/SRPMS/ data/fs/ ([B]see [/B]2- Data, filesystem backups)
backup_script /root/scripts/backupv3/backup_iworx_db.sh data/mysql/iworx/ ([B]see [/B]3- Mysql backups)
backup_script /root/scripts/backupv3/backup_users_db.sh data/mysql/users/ ([B]see [/B]3- Mysql backups)
1- backup_script /root/scripts/backupv3/so_backup.sh structure/
It is the iworx structure only backup script.
It looks for all siteworx accounts, find the IP and create a directory structure based on the IP. It backups all iworx account structure only backups in the good IP directory
see here for the script http://www.interworx.com/forums/showpost.php?p=13390&postcount=5
here the result
for example
ls /backups/daily.0/
data structure
ls -al /backups/daily.0/structure/
ip-65.110.xx.xx0 ip-65.110.xx.xx1 ip-65.110.xx.xx2 ip-65.110.xx.xx3 ip-65.110.xx.xx4
etc…
ls -al /backups/daily.0/structure/ip-65.110.xx.xx5/
domain-01.com-structure-Jun.08.2007-01.20.42.tgz domaine-02.com-structure-Jun.08.2007-01.21.01.tgz
etc…
2- Data, filesystem backups
We then do a rsync of /home, some important config files (
passwd, group, host_allow, etc), the cron file of the users (/var/spool/cron/ ) etc…
You can set what you want here !
These data are rsynced in a /data/fs/ directory
ls /backups/daily.0/data/fs/
chroot etc root usr var
ls /backups/daily.0/data/fs/chroot/home/
account01 account02 account03 interworx …
etc
ls /backups/daily.0/data/fs/etc/
group hosts hosts.allow hosts.deny httpd passwd proftpd.conf resolv.conf shadow
etc
The needed files for iworx only are :
/home/account/*
But us, we do all /home !
There is also a “exclude file” that list all directory that you want to exclude
exclude_file /root/scripts/snapshot_exclude
Today we exclude some /home directory, the client iworx backups and all stats data oldest than this year
#Exclude rsync dir
/chroot/home/qscand
/chroot/home///iworx-backup
/chroot/home//var//stats/analog/daily/2005*
/chroot/home//var//stats/analog/daily/2005
/chroot/home//var//stats/analog/daily/2006*
/chroot/home//var//stats/analog/daily/2006
/chroot/home//var//stats/analog/weekly/2005*
/chroot/home//var//stats/analog/weekly/2005
/chroot/home//var//stats/analog/weekly/2006*
/chroot/home//var//stats/analog/weekly/2006
/chroot/home//var//stats/analog/monthly/2005*
/chroot/home//var//stats/analog/monthly/2006*
/chroot/home//var//stats/awstats/daily/awstats05
/chroot/home//var//stats/awstats/daily/awstats06
3- Mysql backups
backup_script /root/scripts/backupv3/backup_iworx_db.sh data/mysql/iworx/
backup_script /root/scripts/backupv3/backup_users_db.sh data/mysql/users/
These two scripts does a mysqldump of the iworx database and users databases and then create a tar.gz of these files !
see he for the script http://www.interworx.com/forums/showpost.php?p=13390&postcount=5
The sql backup file are in data/mysql/iworx/ and data/mysql/users/
ls /backups/daily.0/data/mysql/
iworx users
ls /backups/daily.0/data/mysql/iworx/
iworx_db.tar.gz
ls /backups/daily.0/data/mysql/users/
users_db.tar.gz
With our 3 scripts ([B]see here for these scripts http://www.interworx.com/forums/showpost.php?p=13390&postcount=5[/B])
- rsnaphot we have a full backup solution, ready for easy restore/import/migration processes
We have the last days, the previous one, one week ago and 1 month ago backup data (iworx structure backups and filesystem data)
Even if we keep this history It takes only just a little more than only oen backup (du to the hard link used by rsnapshot)
We are going to create a SRPM of this solution, which will install everything.
You’ll then be able to set what you want by editing two configs file
If some of you are interested, we’ll give this script asap
Pascal