ISPConfig 3 - back-res a Backup and Restore script

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

  1. toyinal

    toyinal Member

    restore a website

    I'm using the back-res ver0.9.6 on centos 6.5 ISPCONFIG 3 box, how do I restore one website. These is no direction for this in the header of the back-res program.

    Thanks
     
  2. Atreides

    Atreides Member

    Dear All,

    I tried to execute /etc/back-res and I get the following message:

    Code:
    /bin/tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
    Try '/bin/tar --help' or '/bin/tar --usage' for more information.
    Should I add one of those values into one of the following lines?

    Code:
    ARG="-cjpSPf"		#sparse				# tar arguments P = removed /.
    EARG="-xjpf"						# tar extract arguments P = removed /
    Thank you very much for your help.
    Best
     
  3. j4v1

    j4v1 New Member

    Hello

    When I restore dirs...
    Code:
    	Extracting i_var_spool-2014-08-25.tar.bz2...
    
    	Extracting i_sbin-2014-08-25.tar.bz2...
    
    	Extracting i_var_www_ispconfig-2014-08-25.tar.bz2...
    
    find: `//all': No such file or directory
    
    
    ---------------------=== The back-res script by go0ogl3 ===---------------------
    
        For a clean backup restored at 2014-08-25 we need now to delete the files
    created after the backup date.
        If exists, a list of files to be deleted follows:
    
    
    Please input "yes" to delete those files, if they exist, and press [ENTER]: yes
    All restore jobs done!
    Dir all restored to date 2014-08-25!
    find: `//all': No such file or directory

    What is this error?



    Thanks in advance
     
  4. zarza

    zarza New Member

    Just for them that want automatically MySQL login, you can set dbpassword var as:

    dbpassword=$(cat /usr/local/ispconfig/server/lib/mysql_clientdb.conf | grep '$clientdb_password' | cut -d"'" -f 2)
     
  5. Ripeed

    Ripeed Member

    Hi, how can I move date of full backup? By this script I make backup of four server to one backup storage. When is firtst of month it is lot of data. So I need to move full backup like 1. 10. 20. 28. of the month. Thanks.
     
  6. tornade69

    tornade69 New Member

    Hi,

    Great solution, but ... i need to export to FTP, so i modify a part of script :
    in Variable i had :
    FTPLOGIN="login" # FTP Login
    FTPPASS="yourpassword" # FTP Password
    FTP="ftp.example.com/mybackup/" # FTP serveur and
    TLS="--disable-tls" # Choose --disable-tls for no tls --force-tls to force using TLS​

    and at the end of the backup function i add
    wput $TLS --basename=$BACKUPDIR"/" $BACKUPDIR"/" ftp://$FTPLOGIN:$FTPPASS@$FTP​

    You may need to : apt-get install wput
    Very great script
    Regards
     
  7. chico11mbit

    chico11mbit Member

    Hi,
    how can i prevent the backup script from creating data in local folder /mnt when nfs-sharepoint is not mounted?

    is there a method to limit the backup cycles to a max number? because my nfs-share runs full.
     
  8. Ripeed

    Ripeed Member

    You can use parameter:
    maxp="85" # Max percent of used space before start of delete
    will it help you?
     
  9. chico11mbit

    chico11mbit Member

    No,
    there are other applications using this device heavily and use much space. and the server only use 150gigs so far. so it would be better so set the available space for the backup-script to e.g. 500gb
     
  10. Geekteq

    Geekteq New Member

    Hm... I keep getting:
    back-res.sh: line 408: [: too many arguments
    When I'm running my backups. Any suggestions?
     
  11. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    looks like there are a number of versions of this script, probably need to indicate which one you're using, or maybe paste a few lines above/below 408 to see what yours is doing there.
     
  12. Geekteq

    Geekteq New Member

    I'm using "version="0.9.6 from 2014-02-04""

    for i in `echo $DIRECTORIES` ; do
    XX=`echo $i | awk '{gsub("/", "_", $0); print}'`
    YX=`echo $i | awk '{print $1}'`
    fb=`ls $BACKUPDIR | grep ^full$XX-`
    --> 408 is this if [ -z $fb ] ; then
    log "No full backup found for $YX. Full backup now!"
    echo > $tmpdir/full-backup$XX.lck
    $TAR $ARG $BACKUPDIR/full$XX-$FDATE.tar.bz2 $YX -X $tmpdir/excluded
    log "Backup of $YX done."
    fi

    # Monthly full backup
    if [ $DOM = "01" ] ; then
    log "Starting full monthly backup for: $YX"
    $TAR $ARG $BACKUPDIR/full$XX-$FDATE.tar.bz2 $YX -X $tmpdir/excluded
    log "Full monthly backup for $YX done."
    else
    # If it's not the first day of the month we make incremental backup
    if [ ! -e $tmpdir/full-backup$XX.lck ] ; then
    log "Starting daily backup for: $YX"
    NEWER="--newer $FDATE"
    $TAR $NEWER $ARG $BACKUPDIR/$MDATE/i$XX-$FDATE.tar.bz2 $YX -X $tmpdir/excluded
    log "Daily backup for $YX done."
    else
    log "Lock file for $YX full backup exists!"
    fi
    fi
    # Clean full backup directory lock file
    rm -rf $tmpdir/full-backup$XX.lck
    done
     
  13. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Change that to (add quotes): if [ -z "$fb" ]; then

    The line 407 ls command is listing several matches, which produces the syntax error; you can see what's going on here:

    Code:
    $ fb="1thing"
    $ if [ -z $fb ]; then echo yes; else echo no; fi
    no
    $ fb="1thing 2things"
    $ if [ -z $fb ]; then echo yes; else echo no; fi
    bash: [: 1thing: binary operator expected
    no
    $ fb="1thing 2things 3things"
    $ if [ -z $fb ]; then echo yes; else echo no; fi
    bash: [: too many arguments
    no
    $ if [ -z "$fb" ]; then echo yes; else echo no; fi
    no
    $
     
    Last edited: Mar 14, 2016
  14. Geekteq

    Geekteq New Member

    That seemed to work, much obliged!
     
  15. Yel

    Yel New Member

    I'm using 0.96 and I have the same error like mentioned by others above, but I could not see a solution. Could anybody help?

    note : Table does not support optimize, doing recreate + analyze instead
    mysqldump: Got error: 1044: Access denied for user 'xxxx'@'localhost' to database 'information_schema' when using LOCK TABLES
    -- Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.
    mysqldump: Got error: 1142: SELECT,LOCK TABL command denied to user 'xxxx'@'localhost' for table 'cond_instances' when using LOCK TABLES
    /bin/tar: /www: Cannot stat: No such file or directory
    /bin/tar: Exiting with failure status due to previous errors
    Can this really be ignored? The log file says 'All backup jobs done. Exiting script!'
     
  16. Geekteq

    Geekteq New Member

    Yes. I can't copy information_schema for some reason
    I changed to WWWDIR="www" and the cannot stat disappeared at least..
     
  17. danjde

    danjde New Member

    Hi friends,

    using for Apache2 accounts an external path to /var, for example on the system root "/MYAPACHE",
    how I should configure the "WWWDIR" variable, considering that the script requires it being within var?

    could be so?
    Code:
    WWWDIR="../MYAPACHE"  # Directory holding websites (global) (must reside in VARDIR!)
    Many thanks!
     
  18. lephuongtrinh

    lephuongtrinh New Member

    thank you very much!
     
  19. Indicium

    Indicium New Member

    Hi, I'm looking to migrate only email accounts with their email content, is it possible ?

    Thanks,
    Indicium
     
  20. Ripeed

    Ripeed Member

    Indicium likes this.

Share This Page