Backup remote server (ISPconfig host)

Discussion in 'Tips/Tricks/Mods' started by Franz, Aug 17, 2009.

  1. Franz

    Franz Member

    i create litle bash script for remote backup my hosting server.

    Script is executed form my home linux server and backup files and database from remote server.

    here is link for script:
    Remota backup linux server
  2. admins

    admins Member HowtoForge Supporter

    Thanks for the script.
    May if we integreat this in the Configpanel, the customers could make her own backup. They could download it to their pc or send per ftp to their other ftp server.

    And when we have a backup import, we do not have any supporttime...

  3. skoena

    skoena Member HowtoForge Supporter

    Hi there,
    Will a backup system be implemented soon? I really need a good backup system.
  4. skoena

    skoena Member HowtoForge Supporter

    Is it possible to backup it to a windows machine?
  5. skoena

    skoena Member HowtoForge Supporter

    I mount my win2003 server on /mnt/servername, so I should be able to backup to this folder.

    I would like to run this script on the server where the script is installed on. (Because with this script you need 2 servers right?)
    I don't want to remote backup a server, what should I change in the script?

    I hope it's clear what I would like to do.
    Or is there an other script available to backups the local server/ispconfig/db's?

  6. Franz

    Franz Member

    i wrote this script for remote backup(for my instalation).

    but I can modify script for local use.
  7. skoena

    skoena Member HowtoForge Supporter

    It would be great if you can modify it for local use with ispconfig. :)
  8. Franz

    Franz Member

  9. skoena

    skoena Member HowtoForge Supporter

    Great script Franz!
    Tnx a lot for your help!
  10. Franz

    Franz Member

    NP. my pleasure to help.
  11. skoena

    skoena Member HowtoForge Supporter

    How's the best way to restore the files (if needed)?
  12. skoena

    skoena Member HowtoForge Supporter

    I think this doesn't work on ubuntu.

    I get this error:
    This means the script will start at 2.02am every day right?
    Last edited: Sep 17, 2009
  13. Franz

    Franz Member

    apt-get install mailutils 
    yes script will be run at 2:02
  14. Franz

    Franz Member

    depend what you need.

    if you need database restore then copy mysqldump files to server and execute:

    bzip2 -d name_of_mysql_dump.bz2
    mysql -uusername -ppassword < mysq_database_dump.sql
    note: this will replace database on server
    for files restore:

    copy all * to server, starting with Monday (because Monday is full backup, and rest days are only incremental of day before till sunday which is last day of week)

    best way is to extract to temp directory and then move to right location, you can chose which files you need to restore.

    to extract file to /ispconfig_restore:
    copy all files to /ispconfig_restore folder
    and extract one file a time starting with FULLbackup:
    tar -xvif name_of_archive_FULL.tar.bz2 -C /ispconfig_restore
    and then for Tuesday
    tar -xvif name_of_archive_Increment_2.tar.bz2 -C /ispconfig_restore
    for wensday:
    tar -xvif name_of_archive_Increment_3.tar.bz2 -C /ispconfig_restore
    and all files are restored into /ispconfig_restore directory.
    and you can move files to original location.

    If you need files from (monday) just extract FULL archive.

    I hope you will manage to restore :)
  15. skoena

    skoena Member HowtoForge Supporter

    How can I change Monday as a Full backup day, can I change it?

    And how is the best way to move the files to the correct dirs after I unpacked the files in a temp dir?

  16. Franz

    Franz Member

    I don't understand? Monday is first day of week on linux system.
    if you want to restore whole directory, just move whole directory do system / directory

    or just copy/move one file which you need to restore.
  17. skoena

    skoena Member HowtoForge Supporter

    I'm having some issues with my server and want to begin from scratch. I learned a lot and want to prevent this by reinstallation.

    So I wanted to reinstall my server today and thought maybe it's a good idea and easier to make a full backup today before my reinstallation of the server.

    But no problem I will wait untill next week to reinstall the server. Or do it later and use the incremental backups.

    (A linux Noob :)
  18. skoena

    skoena Member HowtoForge Supporter

    One other thing/question:
    When I do this reinstallation of my server what's the correct procedure to get back my settings of ispconfig (like sites, email settings, clients etc)? Can you give me some tips?

  19. Franz

    Franz Member

    in script replace

    DF_X=`date +'%u'`
    so it will be always 1. day of week
  20. autogun

    autogun New Member

    Dear Franz,

    Thank you so much for this wonderful script, doing exactly what I've been looking for..

    One tweak is needed tho,
    Since my remote server is set to "PermitRootLogin no", im unable to log-in as root and running the script under different user output lots of "Premission denied"..

    Can this script somehow be tweaked to use sudoer in order to gain root access?

    Thanks a bunch in advance!

Share This Page