HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=25)
-   -   I want to run a backup script, what folder would be best to place it in? (http://www.howtoforge.com/forums/showthread.php?t=56616)

chaloum 20th March 2012 13:03

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:

Code:

THESITE=the_name_of the _site
THEDB=The_Name_of_the_DB
THEDBUSER=The DB_users_name
THEDBPW='The_DB_users_password'
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 127.0.0.1  $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

till 20th March 2012 13:10

Quote:

would it be best in the /var folder or the /var/www folder?
I would place the backups in e.g. /var/backup

By the way, a full site and DB backup is already implemented in ISPConfig SVN version which will be released as ISPConfig 3.0.5.

chaloum 20th March 2012 13:12

when will it be out?
 
Till that is great news, when will the new ISPConfig be out? I assume SVN=subversion?

till 20th March 2012 13:50

There is no release date for 3.0.5 yet, I expect it to be released this year in summer.

Quote:

I assume SVN=subversion?
yes.

chaloum 20th March 2012 13:56

where is the location of mysql?
 
on a mac mysqldump is at this location /usr/local/mysql-5.5.12-osx10.6-x86_64/bin/

where is is in the Centos/ISPConfig world?

till 20th March 2012 14:14

Run:

which mysqldump

to get the location.

chaloum 20th March 2012 14:16

so simple
 
that's so simple thanks :)

chaloum 20th March 2012 14:37

last question, for now..
 
I assume the user website loacation/s is

/var/www/clients/client(x)/web(x)/web

where x= the client and web number

is this correct?

till 20th March 2012 16:08

Yes, thats correct. And there are symlinks to this directory from /var/www and some other locations for easier shell navigation.


All times are GMT +2. The time now is 20:19.

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