Prev Previous Post   Next Post Next
  #1  
Old 15th May 2006, 19:57
chrno chrno is offline
Member
 
Join Date: Apr 2006
Posts: 70
Thanks: 0
Thanked 1 Time in 1 Post
Default 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/*
Reply With Quote
Sponsored Links
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
backup and restore provell Installation/Configuration 4 2nd May 2006 12:21
Backup question Piccent Installation/Configuration 10 13th March 2006 00:12
email + backup blackflag Installation/Configuration 3 7th March 2006 11:38
TPS Fedora Core 4 Managing e-mail adr + Backup Hagforce HOWTO-Related Questions 9 22nd February 2006 14:59
Command Line backup themachine Feature Requests 0 17th October 2005 00:40


All times are GMT +2. The time now is 08:11.


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