Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 6th March 2010, 15:22
datahellas datahellas is offline
Junior Member
 
Join Date: Aug 2005
Location: Athens, Greece
Posts: 13
Thanks: 0
Thanked 4 Times in 1 Post
Default 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.

Last edited by datahellas; 6th March 2010 at 15:27.
Reply With Quote
The Following 4 Users Say Thank You to datahellas For This Useful Post:
Andesh (20th July 2010), falko (7th March 2010), Rescue9 (31st March 2010), till (11th April 2010)
Sponsored Links
  #2  
Old 11th April 2010, 10:15
skoena skoena is offline
Senior Member
 
Join Date: Sep 2009
Location: Emmen, Netherlands
Posts: 421
Thanks: 78
Thanked 14 Times in 12 Posts
Send a message via MSN to skoena Send a message via Skype™ to skoena
Default

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.

Last edited by skoena; 11th April 2010 at 10:25.
Reply With Quote
  #3  
Old 11th April 2010, 12:44
yoplait yoplait is offline
Senior Member
 
Join Date: Dec 2009
Posts: 144
Thanks: 50
Thanked 14 Times in 11 Posts
Default

The "which tar" commande will say to the $TAR variable where is your tar command ... Don't bother about this (i think..)
Reply With Quote
  #4  
Old 31st December 2011, 17:24
yanger yanger is offline
Junior Member
 
Join Date: Oct 2009
Location: Wisconsin
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Default

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?
Reply With Quote
  #5  
Old 18th January 2012, 13:59
helly88 helly88 is offline
Member
 
Join Date: May 2011
Posts: 37
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Does the script still work? I'm running Centos 5.x and ISPconfig 3
Reply With Quote
  #6  
Old 18th January 2012, 17:47
tio289 tio289 is offline
Member
 
Join Date: Mar 2009
Posts: 70
Thanks: 2
Thanked 14 Times in 9 Posts
Default

Why you don't use incremental backups? Look at rdiff-backup http://www.howtoforge.com/linux_rdiff_backup
__________________
Independent Senior Webdeveloper
Reply With Quote
  #7  
Old 22nd April 2012, 17:16
lobius lobius is offline
Member
 
Join Date: Apr 2012
Posts: 41
Thanks: 1
Thanked 0 Times in 0 Posts
 
Default

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 View Post
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.
Reply With Quote
Reply

Bookmarks

Tags
backup, ispconfig 3, script

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
ISPConfig 3 - back-res a Backup and Restore script go0ogl3 Plugins/Modules/Addons 222 26th August 2014 06:00
freebsd 7, samba 3, domain controller alexdimarco Suggest HOWTO 6 5th November 2010 17:54
Backup Script now Failing atjensen11 Server Operation 2 21st February 2010 17:34
Online Backup : What do you use and how do you setup it ? XZed Technical 5 4th January 2010 19:02
Shell Script backup a file HELP anything Programming/Scripts 4 5th February 2008 19:09


All times are GMT +2. The time now is 02:43.


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