View Single Post
Old 20th March 2012, 14:03
chaloum chaloum is offline
Join Date: Mar 2012
Posts: 83
Thanks: 1
Thanked 0 Times in 0 Posts
Default I want to run a backup script, what folder would be best to place it in?

I want to run a backup script, what folder would be best to place it in?

I have a backup script (sh) Which does a mysql dump and zips the dump and the website files together in a folder

the code is as below, The floder locations are as they are on a mac but would change to reflect the ISPConfig folder locations:

THESITE=the_name_of the _site
THEDBUSER=The DB_users_name
THEDATE=`date +%d%m%y%H%M`
THEHOST='THE_host_mostprobably local'
/usr/local/mysql-5.5.12-osx10.6-x86_64/bin/mysqldump -u $THEDBUSER -h  $THEDB | gzip > /Library/WebServer/Documents/backups/files/dbbackup_${THEDB}_${THEDATE}.bak.gz

tar czf /Library/WebServer/Documents/backups/files/sitebackup_${THESITE}_${THEDATE}.tar -C / Library/WebServer/Documents/$THESITE
gzip /Library/WebServer/Documents/backups/files/sitebackup_${THESITE}_${THEDATE}.tar

find /Library/WebServer/Documents/backups/files/site* -mtime +5 -exec rm {} \;
find /Library/WebServer/Documents/backups/files/db* -mtime +5 -exec rm {} \;

This process keeps the last 5 backups before overwriting the oldest backup, this can be changes to suit.The backup would then be resync'd to another raid array

From what I understand ISPConfig only does a file level backup and it would be great if ISPConfig did this (the above code) out of the box as all the info is there when creating a client and site etc.

But in the absence of a full site and DB backup I want to use my script.

So from and admin point of view, What folder would I be best putting this in?
I need to have a folder called backup and inside the backup folder I need folder called files.

would it be best in the /var folder or the /var/www folder?

any assistance would be appreciated
Reply With Quote
Sponsored Links