HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Tips/Tricks/Mods (http://www.howtoforge.com/forums/forumdisplay.php?f=29)
-   -   Backup script for ISPConfig 3 (http://www.howtoforge.com/forums/showthread.php?t=43886)

datahellas 6th March 2010 14:22

Backup script for ISPConfig 3
 
I needed a backup script for ISPConfig 3. I found this one by go0ogl3 but it was not exactly what I needed. I needed to backup the databases and only the clients/clientX/webX/ directories for each web site on the server. So I created a shell script for backup (not restore) that it is very simple but works excellent (at least on my server).

The script will take a daily backup and a weekly backup. The daily backup is being refreshed everyday while the weekly backup every Sunday. The weekly backup is the last daily backup taken (Saturday's backup).

Link to the script:
ISPConfig3 backup script


Rename it to ispc3backup.sh and chmod to 777 before you use it.
Open the file and set the variables in the very beginning (BACKUPDIR, CLIENTSDIR, DBUSER, DBPASS).
Install a crontab like the following to run it daily:

30 04 * * * /backup/ispc3backup.sh &> /dev/null

The script will put backups into these dirs:
BACKUPDIR/db/daily/
BACKUPDIR/db/weekly/
BACKUPDIR/webs/daily/
BACKUPDIR/webs/weekly/


I don't provide any support for this script. If you like it, use it.
Greetings from the Elxis CMS Team.

skoena 11th April 2010 09:15

What's the correct procedure to restore the files?

One question more. It asks for "TAR=`which tar` # name and location of tar". What should I use here? (I use Ubuntu 9.04)

Rudolf.

yoplait 11th April 2010 11:44

The "which tar" commande will say to the $TAR variable where is your tar command ... Don't bother about this (i think..)

yanger 31st December 2011 16:24

changed `which tar` to /usr/bin/nice -3 /bin/tar so that it doesn't clobber the CPU load :] not that i think it really needs it, but depending on how heavy your server gets, this may be "nicer"..

also, any way to backup postfix and ispconfig3 settings without going through the whole ispconfig3 configuration?

helly88 18th January 2012 12:59

Does the script still work? I'm running Centos 5.x and ISPconfig 3

tio289 18th January 2012 16:47

Why you don't use incremental backups? Look at rdiff-backup http://www.howtoforge.com/linux_rdiff_backup

lobius 22nd April 2012 16:16

Okay… Dumb question time:

Do I have to make those directories? Do I have to make them writable?

Would it be wiser to use chown root:root instead of chmod 777?

Quote:

Originally Posted by datahellas (Post 221252)
I needed a backup script for ISPConfig 3. I found this one by go0ogl3 but it was not exactly what I needed. I needed to backup the databases and only the clients/clientX/webX/ directories for each web site on the server. So I created a shell script for backup (not restore) that it is very simple but works excellent (at least on my server).

The script will take a daily backup and a weekly backup. The daily backup is being refreshed everyday while the weekly backup every Sunday. The weekly backup is the last daily backup taken (Saturday's backup).

Link to the script:
ISPConfig3 backup script


Rename it to ispc3backup.sh and chmod to 777 before you use it.
Open the file and set the variables in the very beginning (BACKUPDIR, CLIENTSDIR, DBUSER, DBPASS).
Install a crontab like the following to run it daily:

30 04 * * * /backup/ispc3backup.sh &> /dev/null

The script will put backups into these dirs:
BACKUPDIR/db/daily/
BACKUPDIR/db/weekly/
BACKUPDIR/webs/daily/
BACKUPDIR/webs/weekly/


I don't provide any support for this script. If you like it, use it.
Greetings from the Elxis CMS Team.



All times are GMT +2. The time now is 07:12.

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