ISPConfig 3 - back-res a Backup and Restore script

Discussion in 'Plugins/Modules/Addons' started by go0ogl3, Dec 6, 2009.

  1. dclardy

    dclardy Member

    Is this script a part of the backup section of ISPConfig?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    No. This is a additional backup script.
     
  3. dclardy

    dclardy Member

    Does the ISPConfig included backup script include databases?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The svn version which will be 3.0.5 yes, the current 3.0.4.4 stable no.
     
  5. dclardy

    dclardy Member

    Thanks, till. I am just going to automysqlbackup for the time being.
     
  6. lobius

    lobius Member

    Three days and I have not had an automated backup yet. I think that means something's not working right.

    In cron...

    Code:
    40 3 * * * /etc/back-res 1>/dev/null 2>/dev/null
    
    Everything looks like it checks out, but nothing is saving to the target directory: /srv/bck.

    Any ideas?
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you get any errors when you run:

    /etc/back-res

    manually as root user on the shell?
     
  8. lobius

    lobius Member

    Typo…

    cron was looking for back-res when the file name was back_res.

    I feel terrible about that one. :-(

    I think it will work just fine now.
     
  9. lobius

    lobius Member

    You must delete my original draft of the previous post. I forgot to remove some critical information.
     
  10. dpetrek

    dpetrek New Member

    back-res

    so i have the back-res working well, however no notification mail is sent when the backup is done. looks like this part is never reached:

    "# Send accumulated maildata an cleanup
    mail -s "Daily backup of $COMPUTER `date +'%F'`" "$email" < $tmpdir/maildata
    rm -rf $tmpdir/datestart
    rm -rf $tmpdir/dateend
    rm -rf $tmpdir/excluded
    rm -rf $tmpdir/maildata
    "

    what could be the reason for this?
     
  11. dipeshmehta

    dipeshmehta Member

    Hello go0ogl3,

    I want to run my backups as - full backups on Sundays and daily incremental backups on weekdays, what changes do I need to make?

    Dipesh
     
  12. harrythehamster

    harrythehamster New Member

    Hello

    I have been advised to use this script to make a backup of my files. I was looking for a way to backup all of my sites on ispconfig and restore them including all mysql databases so that I can install a fresh ispconfig install if my server gets comprimised.

    I have managed to make the backups but I cannot work out how the restore part works.

    I am using Debian 6 and any advice would be great :)
    Thanks.
     
  13. concept21

    concept21 Active Member

    VM is the Perfect Solution. VM is better than physical server from the viewpoint of maintenance and security. :)
     
  14. harrythehamster

    harrythehamster New Member

    Hello

    I am still very unclear on how you restore the backup files that are created with the backup script. The script says backup and restore. I have managed the backup bit but how do you restore the files please.

    This is the only thing now stopping me from using ISPConfig on my vps server to host my sites and blogs. As soon as I have this sorted out I can go ahead and move my sites to my vps knowing that they would be secure and I would have a backup to restore if my vps got comprimised.

    Thanks :)
     
    Last edited: Nov 27, 2012
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Take a look into the script, the restore procedure is described in the comments at the beginning of the script:

     
  16. harrythehamster

    harrythehamster New Member

    Thanks for your reply Till

    I have read the 'comments' section of the script and that is what I cannot understand.

    So lets say for example my vps gets comprimised/hacked and I have to reinstall ispconfig 3 and I need to reinstall all of my sites from the backup.

    How do I do this?

    Do I upload all of the backup files that I downloaded prior to me reinstalling the OS and Ispconfig then use SSH and put the command:-

    back-res db mysql date

    and so on to restore all of those files and have my ftp, mysql databases, sites and blogs working again?

    Thanks
     
  17. Fredda

    Fredda New Member

    Complete backup and restore

    Hello,

    It's been awhile since I last was on this forum, so my old user was deleted :)
    My hosting company is upgrading their infrastructure, so I have to upgrade my server. The old server is running Ubuntu 10.04 with Ispconfig3, on the new server I have installed Ubuntu 12.04 and Ispconfig3.

    Can I use this script to backup the old server and restore it on the new server without any compatibility issues?

    Thanks for the great software and forum! :)
     
  18. chmadk

    chmadk New Member

    Problems with script

    Hello.

    Now ive tried both an Ubuntu 12.10 Server
    And an debian 6.

    Both of them can backup just fine !

    but when i try the restore database. I get the mysql -x error.. its on all of the servers.. It looks like its eating the Tar command in the script and then not knowing what to do next
     
  19. chmadk

    chmadk New Member

    Since nobody ddid anything i did it myself..

    i know it may not be the best way to do it.. but now it works for me at least !
    From line 550 and forward.. this fixes the restore script if you keep getting the -x is not valid blah blah.
    Code:
    for i in $arh ; do
                    rdb=`echo $i | cut -d "-" -f2`
                    edb=`echo $i | cut -d "." -f1`
                    $TAR $EARG $BACKUPDIR/$YDATE-$MDATE/$i
                    mysql -u$dbuser -p$dbpassword $rdb < $edb.sql
                    rm $edb.sql
                done
    
     
  20. Rashef

    Rashef New Member

    Hi guys,
    using the script on a CentoOS with ISPConfig3, I get the following output:

    Code:
    # ./bak-res.sh 
    ./bak-res.sh: line 226: /tmp/tmpbck/maildata: No such file or directory
    ./bak-res.sh: line 229: /tmp/tmpbck/maildata: No such file or directory
    ./bak-res.sh: line 235: /tmp/tmpbck/maildata: No such file or directory
    ./bak-res.sh: line 220: /tmp/tmpbck/maildata: No such file or directory
    ./bak-res.sh: line 220: /tmp/tmpbck/maildata: No such file or directory
    ./bak-res.sh: line 220: /tmp/tmpbck/maildata: No such file or directory
    c1gus01.ft_rp_address
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_event_cite
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_event_detail
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_event_note
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_fam
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_fam_child
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_fam_cite
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_fam_event
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_fam_note
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_header
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_indi
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_indi_cite
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_indi_event
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_indi_fam
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_indi_name
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_indi_note
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_indi_option
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_name_cite
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_name_name
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_name_note
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_name_personal
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_note
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_repo
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_repo_note
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_source
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_source_cite
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_source_note
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_submitter
    note     : Table does not support optimize, doing recreate + analyze instead
    c1gus01.ft_rp_submitter_note
    note     : Table does not support optimize, doing recreate + analyze instead
    mysql.general_log
    note     : The storage engine for the table doesn't support optimize
    mysql.slow_log
    note     : The storage engine for the table doesn't support optimize
    mysqldump: Got error: 1044: Access denied for user 'root'@'localhost' to database 'information_schema' when using LOCK TABLES
    tar (child): /bkp/MYSERVER/myserver.int/2013-02/db-c1doop-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/2013-02/db-c1gus01-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/2013-02/db-c1icom01-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/2013-02/db-c1meu01-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/2013-02/db-c1morg01-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/2013-02/db-c2nitesite-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/2013-02/db-dbispconfig-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/2013-02/db-mysql-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/full_boot-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/full_etc-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/full_home-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    /bin/tar: Child returned status 2
    /bin/tar: Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/full_lib-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/full_root-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    /bin/tar: Child returned status 2
    /bin/tar: Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/full_sbin-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/full_usr-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    tar (child): /bkp/MYSERVER/myserver.int/full_var-2013-02-06.tar.bz2: Cannot open: Permission denied
    tar (child): Error is not recoverable: exiting now
    /bin/tar: /www: Cannot stat: No such file or directory
    /bin/tar: Exiting with failure status due to previous errors
    ./bak-res.sh: line 219: /bkp/MYSERVER/myserver.int/log/backup.log: Permission denied
    ./bak-res.sh: line 219: /bkp/MYSERVER/myserver.int/log/backup.log: Permission denied
    [Exit 1]
    Just FYI, I mounted my BOX.NET folder on /bkp using davfs2 and I can perfectly write in there, but:
    • full_www-2013-02-06.tar.bz2 is actually empty
    • There are only 1 DB out of 7 and db-information_schema in the DB folder

    what's wrong?
     

Share This Page