1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

Backup Skript

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

  1. Herby

    Herby Guest

    0
     
    Hi,

    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)

    /home/httpd/vhosts/
    /var/qmail/
    /var/log/
    /var/drweb/
    /var/named/
    /etc/httpd/conf/
    /usr/local/psa/etc/
    /usr/local/psa/var/
    /usr/local/psa/admin/conf/httpsd.conf

    +all existing databases

    Anything missing?

    br,
    herby
     
  2. serve-you.net

    serve-you.net Guest

    0
     
    I generally do the following directories:
    /etc
    /home
    /usr/local/psa
    /var

    I actually just wrote a tutorial for using rsync over ssh on a new site I'm developing here:
    www.unix-serve.com
    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

    0
     
    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?
    br,
    herby
     
  4. stratigos

    stratigos Guest

    0
     
    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

    0
     
    lol i know this.

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