ISPConfig 3 - back-res a Backup and Restore script

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

  1. danjde

    danjde New Member

    Hi Friends!
    Running back-res, after db backup, obtain this warnings/errors:

    /sbin/back-res: line 407: [: too arguments
    /bin/tar: /www: function "stat" failed: File or directory does not exist
    /bin/tar: Exit with failure status based on previous errors

    This is the part of the script concerned:

    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-`
            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."

    the 407 line is this:

    if [ -z $fb ] ; then
    Why is this happening? Do I have something wrong?

    Many many thanks!
  2. Geekteq

    Geekteq New Member

    If you had read the thread a few back you'd find the same already discussed.
    Look here #233
  3. danjde

    danjde New Member

    Thanks Geekteq, I didn't see the previous post :confused:
    Now, with the changes, it works fine!
    Strange that the developer has not yet corrected the bug! I'll try to report it to him.
  4. danjde

    danjde New Member

    Hi Friends,
    after to have corrected the bug described above,
    today (at the first one month day backup time) just a few minutes after starting the "back-res" script the MySQL server hangs:

    service mysql stop
    service mysql start
    Job for mysql.service failed. See 'systemctl status mysql.service' and 'journalctl -xn' for details.
    systemctl status mysql.service
    ● mysql.service - LSB: Start and stop the mysql database server daemon
       Loaded: loaded (/etc/init.d/mysql)
       Active: failed (Result: exit-code) since lun 2018-01-01 15:49:30 CET; 10s ago
      Process: 18210 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
      Process: 18261 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)
    gen 01 15:49:30 server /etc/init.d/mysql[19100]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
    gen 01 15:49:30 server mysql[18261]: Starting MySQL database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
    gen 01 15:49:30 server systemd[1]: mysql.service: control process exited, code=exited status=1
    gen 01 15:49:30 server systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
    gen 01 15:49:30 server systemd[1]: Unit mysql.service entered failed state.
    Then reloading again the MySQL server, everything is broken down correctly.

    Has anyone of you encountered similar problems?

    Many thanks!

  5. yodaofborg

    yodaofborg New Member

    Still a great script after all this time, the only problem I have with it is it does not exclude directories from /var with the latest update, even if specified. log, spool, run, are all added due to the script recursive adding them in the # Add /var excluding subdirectories /var/www and /var/vmail to DIRECTORIES section. (debian 9.4 with version="0.9.6 from 2014-02-04")

    Still, great way of keeping daily backups of my sites, I just hate to waste disk space on things I do not need backed up :)


    Just fixed this myself, the tar command in debian 9 needs the -X option set before telling it what to backup, or it will include the files it has been told to (expected behaviour for GNU tar, since forever?), so changing the lines (around line 407) from:
    $TAR $ARG $BACKUPDIR/full$XX-$FDATE.tar.bz2 $YX -X $tmpdir/excluded
    $TAR $ARG $BACKUPDIR/full$XX-$FDATE.tar.bz2 $YX -X $tmpdir/excluded
    $TAR $NEWER $ARG $BACKUPDIR/$MDATE/i$XX-$FDATE.tar.bz2 $YX -X $tmpdir/excluded 
    $TAR $ARG $BACKUPDIR/full$XX-$FDATE.tar.bz2 -X $tmpdir/excluded $YX
    $TAR $ARG $BACKUPDIR/full$XX-$FDATE.tar.bz2 -X $tmpdir/excluded $YX
    $TAR $NEWER $ARG $BACKUPDIR/$MDATE/i$XX-$FDATE.tar.bz2 -X $tmpdir/excluded $YX
    fixed the issue.
    Last edited: May 18, 2018
    Gruppo Pegaso and ahrasis like this.
  6. toyinal

    toyinal Member

    I'm unable to restore /var directory from a date 2018-08-29 Im using back-res version 0.9.6 The program will all show blank when restoring but no files are restored. Also restoring a specific /var/vmail/xxxxx.tld from a particular date does not work. I know there is a backup file .tar.bz2 for that date and for that specific account, i've checked. Full backup restore works. I know that specific date restore works before the update to version 0.9.6

  7. dejvic

    dejvic New Member

    please have you got anyone right script for backup and restore ispconfig3 ver. to last version?

Share This Page