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

Discussion in 'General' started by chaloum, Mar 20, 2012.

  1. chaloum

    chaloum New Member

    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
     
  2. till

    till Super Moderator

    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.
     
  3. chaloum

    chaloum New Member

    when will it be out?

    Till that is great news, when will the new ISPConfig be out? I assume SVN=subversion?
     
    Last edited: Mar 20, 2012
  4. till

    till Super Moderator

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

    yes.
     
  5. chaloum

    chaloum New Member

    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?
     
  6. till

    till Super Moderator

    Run:

    which mysqldump

    to get the location.
     
  7. chaloum

    chaloum New Member

    so simple

    that's so simple thanks :)
     
  8. chaloum

    chaloum New Member

    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?
     
  9. till

    till Super Moderator

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

Share This Page