ISPConfig 3 - back-res a Backup and Restore script

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

  1. Ripeed

    Ripeed Member

    Hi, I using this script for backup. Then I copy backup folder by rsync to another computer.

    Can any one give me advice how to set the script to backup to another computer directly. I dont need two same backup on two PCs.

    I think I will do that by scp?
  2. Ripeed

    Ripeed Member

    I am trying to restorade dir by:
    ./ dir /var/vmail/domain.tld 2013-04-06 /tmp

    and I get:
    ./ line 575: /tmp/tmpbck/maildata: No such file or directory

    So I whant restore backup to /tmp not in that folfer above.

    Abyway if I create folde /tmp/tmpbck/maildata I get:
    Null message body; hope that's ok

  3. go0ogl3

    go0ogl3 Member

    From the script:

    # To restore dirs make sure you have the full backup from that month and use:
    # `back-res dir /etc 2009-11-23 /`
    # to restore the "/etc" dir from date 2009-11-23 to root
    # `back-res dir /etc 2009-11-23 /tmp` is used to restore the "/etc" dir to /tmp
    # `back-res dir all 2009-11-23 /`
    # to restore all directories from date 2009-11-23 to root

    Note: You try to restore /var/vmail/domain.tld this dir was backed-up? or it was /var/vmail or just /var ?

    ./ dir /var 2013-04-06 /tmp

    but this depends on your settings.

    P.S.: You can safely ignore the /tmp/tmpbck/maildata error - it's a file used to send mail to you...
  4. Ripeed

    Ripeed Member

    THX go0ogl3 but I found where was problem. Before I dont understant that.

    If I backing up /var/www folder and in that folder have another folder lilke:


    Than I can´t restore folder var/www/web3 but I must restore folder var/www, what I have set in config part of script.

    am I right?
  5. teratoon

    teratoon New Member


    To restore complete /var folder is little bit risky and time consumed if i only wanna restore one mailbox /var/vmail/domain/user.There's only way then change script backup directories and add /var/vmail ? but then are double backups /var and /var/vmail.

    Any ideas how to develop script to more comfortable ?
  6. sjswarts

    sjswarts New Member

    Couldn't you just stipulate exactly what you wanted in /var to be backed up to prevent double backups?

    For example instead of backing up /var try to backup the following:


    I haven't tried it but tonight I had issues with not being able to restore just my /var/www folder, so now I sit and wait for the whole /var folder to be restored...

    Nice script, but a bit clunky.

    P.S. I haven't tried this myself, no warranty given ;)
  7. sjswarts

    sjswarts New Member

    Anyone able to provide me with help in restoring data?

    Little background:

    I use the backup script on my main server running on a VDS debian. I have a mounted folder /backup that uses ssh to securely mount a remote directory on my home server at /backup as well. It works fine. I can see everything is there, log is updated, etc.

    Now the issue is that my internet between home and the VDS sucks, so uploads are maximum 70kb/s more like 50kb/s ... yes I know Australia's internet sucks :(

    My question is if I use the script on the hosted server like its meant to be:

    ./ dir /var 2013-09-01 /tmp

    then it tries to extract the backup to my hosted server. Also if I try this:

    ./ dir /var 2013-09-01 /backup/tmp

    trying to utilize the backup to be stored on the same server as what holds the incremental backups, it goes slow as well.

    So is there a way to irrespective of where the backup came from, working on the home server run some form of backup script restore locally?

    Hopefully someone can wade through my dilemma...

    I will definitely be changing my script to use sub-directories because all I want is a fraction of /var and currently its 4GB of data I need to extract...

    thanks in advance
  8. ilgio

    ilgio New Member

    but this script works also for transfer ispconfig from PC A to PC B ?

    and the account and password who create ispconfig?
  9. griven

    griven New Member


    I try to run this Script on a Debian based server but get the following Errors:
    what can I do to fix this problem?
  10. mailinh

    mailinh New Member

    That's my problem width me! And I don't know how to fix it, too!
  11. sheshes

    sheshes Member

    Script runs without error but files are not restored

    Guys I have a huge problem. After a server crash I have reformatted everything and resetup ispconfig (this time with dovecot instead of courier)

    I am running the script to restore my backups and I get all jobs done etc but NO files at all are restored. I even tried restoring in /tmp so I can see the exact files but there aren't any.

    Any ideas?
  12. fino

    fino New Member

    mysql: unknown option '-x'

    I can not understand why, back-res version is latest version (version = "0.9.4 from 2010-09-13") the variable $ TAR "which tar". the version of the installed distribution is Ubuntu 12.04 server.

    mysql -u$dbuser -p$dbpassword $rdb < $TAR -xvjp $BACKUPDIR/$YDATE-$MDATE/$i

    + mysql -uroot -p09qwlk mysql -xvjp /bck/
    mysql: unknown option '-x'
    + for i in '$arh'
    ++ echo db-c21mvirtuale-2014-01-05.tar.bz2
    ++ cut -d - -f2
    + rdb=c21mvirtuale
    + mysql -uroot -p09qwlk c21mvirtuale -xvjp /bck/
    mysql: unknown option '-x'
    + for i in '$arh'
    ++ echo db-roundcube-2014-01-05.tar.bz2
    ++ cut -d - -f2
    + rdb=roundcube
    + mysql -uroot -p09qwlk roundcube -xvjp /bck/
    mysql: unknown option '-x'
    + for i in '$arh'
    ++ echo db-c11wordpress-2014-01-05.tar.bz2
    ++ cut -d - -f2
    + rdb=c11wordpress
    + mysql -uroot -p09qwlk c11wordpress -xvjp /bck/
    mysql: unknown option '-x'
    + for i in '$arh'
    ++ echo db-c7www-2014-01-05.tar.bz2
    ++ cut -d - -f2
    + rdb=c7www
    + mysql -uroot -p09qwlk c7www -xvjp /bck/
    mysql: unknown option '-x'
    + for i in '$arh'
    ++ echo db-vtigercrm510-2014-01-05.tar.bz2
    ++ cut -d - -f2
    + rdb=vtigercrm510
    + mysql -uroot -p09qwlk vtigercrm510 -xvjp /bck/

    Tnx have a nice day
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Which Linux distribution and version do you use and which mysql version is installed on your server?
  14. fino

    fino New Member

    ubuntu server 12.04
    Mysql 5.5

    Tnx a lot
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok. What is the output of the command:

    which tar
  16. fino

    fino New Member

    this /bin/tar
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    try to replace the line:

    TAR=`which tar`



    in the back-res script.
  18. fino

    fino New Member

    the same error i test this 10 minute before. I send you private message

  19. fino

    fino New Member

    cat back-res |grep -i /bin/tar
    TAR="/bin/tar" # name and location of tar

    mysql: unknown option '-x'
    + for i in '$arh'
    ++ echo db-c23web-2014-01-05.tar.bz2
    ++ cut -d - -f2
    + rdb=c23web
    + mysql -uroot -pxxx c23web -xvjp /bck/
    mysql: unknown option '-x'

    Is the same
  20. bluebirdnet

    bluebirdnet Member

    Anyone have an idea why i would be getting this error ? The mysqlcheck runs fine with root credentials and i can login to mysql from shell using root.

    mysqldump: Got error: 1044: Access denied for user 'root'@'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 'root'@'localhost' for table 'cond_instances' when using LOCK TABLES

Share This Page