HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=16)
-   -   Incremental Backup (http://www.howtoforge.com/forums/showthread.php?t=4317)

chrno 15th May 2006 19:57

Incremental Backup
 
Hi,

I've setup the following script to run in crontab on my Debian box. The idea is to backup all of ISPConfig's setting and upload it to another FTP server. It is based around a 7 day incremental backup strategy, where 1 full backup is made each week and daily incremental backup's are made in-between. This will enables data to be restored from any day within that week.

Quote:

Question:-
Are there any flaws in this strategy? i.e. if I had to rebuild another server from scratch, I should be able to just restore the data isn't it?

Weekly Full Backup
Code:

#!/bin/sh
cd /mnt/backups
rm /mnt/backups/*
tar pczvf - --listed-incremental /mnt/backups/etc-log.snar /etc | split -b 20m - /mnt/backups/etc-full-`date '+%d-%B-%Y'`.tar.gz.
tar pczvf - --listed-incremental /mnt/backups/www-log.snar /var/www | split -b 20m - /mnt/backups/www-full-`date '+%d-%B-%Y'`.tar.gz.
tar pczvf - --listed-incremental /mnt/backups/bind-log.snar /var/lib/named/etc/bind | split -b 20m - /mnt/backups/bind-full-`date '+%d-%B-%Y'`.tar.gz.
tar pczvf - --listed-incremental /mnt/backups/ispconfig-log.snar /root/ispconfig | split -b 20m - /mnt/backups/ispconfig-full-`date '+%d-%B-%Y'`.tar.gz.
tar pczvf - --listed-incremental /mnt/backups/admispconfig-log.snar /home/admispconfig | split -b 20m - /mnt/backups/admispconfig-full-`date '+%d-%B-%Y'`.tar.gz.
mysqldump --opt -u %USERNAME% --password="%PASSWORD%" --all-databases --add-drop-database --add-drop-table | bzip2 -c > /mnt/backups/%SERVERNAME%-`date '+%d-%B-%Y'`.sql.bz2
ftp-upload -h %FTP-ADDRESS% -u %USERNAME% --password %PASSWORD% -b -d /private/backup/ /mnt/backups/*


Daily Incremental Backup
Code:

#!/bin/sh
cd /mnt/backups
tar pczvf - --listed-incremental /mnt/backups/etc-log.snar /etc | split -b 20m - /mnt/backups/etc-`date '+%d-%B-%Y'`.tar.gz.
tar pczvf - --listed-incremental /mnt/backups/www-log.snar /var/www | split -b 20m - /mnt/backups/www-`date '+%d-%B-%Y'`.tar.gz.
tar pczvf - --listed-incremental /mnt/backups/bind-log.snar /var/lib/named/etc/bind | split -b 20m - /mnt/backups/bind-`date '+%d-%B-%Y'`.tar.gz.
tar pczvf - --listed-incremental /mnt/backups/ispconfig-log.snar /root/ispconfig | split -b 20m - /mnt/backups/ispconfig-`date '+%d-%B-%Y'`.tar.gz.
tar pczvf - --listed-incremental /mnt/backups/admispconfig-log.snar /home/admispconfig | split -b 20m - /mnt/backups/admispconfig-`date '+%d-%B-%Y'`.tar.gz.
mysqldump --opt -u %USERNAME% --password="%PASSWORD%" --all-databases --add-drop-database --add-drop-table | bzip2 -c > /mnt/backups/%SERVERNAME%-`date '+%d-%B-%Y'`.sql.bz2
ftp-upload -h %FTP-ADDRESS% -u %USERNAME% --password %PASSWORD% -b -d /private/backup/ /mnt/backups/*


falko 16th May 2006 16:51

Have a look at this thread to see what you need to back up: http://www.howtoforge.com/forums/sho...move+ispconfig

chrno 17th May 2006 12:10

Cool thanks! Looks like I've got everything covered :D


All times are GMT +2. The time now is 09:15.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.