1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Backup Skript

Discussion in 'Plesk for Linux - 8.x and Older' started by Herby, Jul 4, 2005.

  1. Herby

    Herby Guest


    I try to build a backupskript, to have a 2nd machine witch same data as server that I can switch to backupserver if something crashes.

    What else should be reverse copied (what could change often ie includes customer details or server settings)


    +all existing databases

    Anything missing?

  2. serve-you.net

    serve-you.net Guest

    I generally do the following directories:

    I actually just wrote a tutorial for using rsync over ssh on a new site I'm developing here:
    It doesn't go into which directories you should backup, as that is unique to each server, but it should give you an idea how to do it pretty painlessly.

    Edit: I forgot to mention MySQL. Although I do backup the raw databases under /var/lib/mysql, I do not use these for restoration. You should use mysqldump or mysqlhotcopy for doing MySQL backups, as they lock the db's during backup to avoid corruption. I prefer mysqldump, because it is fast and simple. To backup all DB's just do something like:
  3. Herby

    Herby Guest

    I am also transfering the files via rsync and ssh. The databases are dumped with:

    mysqldump -qQ -u user -ppass --opt --all-databases > db.sql

    But at restore I am running into a problem::
    mysql -u user -ppass < db.sql
    ERROR 1064 at line 11: You have an error in your SQL syntax near '-1062505950' at line 1

    Line 11:
    CREATE DATABASE /*!32312 IF NOT EXISTS*/ Mambo-1062505950;

    I think the problem could be solved if there would be a way to quote the db-name also but I couldn't find an option for that.

    Any hints?
  4. stratigos

    stratigos Guest

    your problem is in the database name...
    In database restore it can't process the "-" sign. Try renaming the database and it will work.
  5. Herby

    Herby Guest

    lol i know this.

    Renaming databases created by default in adminpanel by any customers isnt a solution.