• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Backup Skript

H

Herby

Guest
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
 
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:
mysqldump -lv -uadmin -p`cat /etc/psa/.psa.shadow -A > mysqldump.sql
 
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
 
your problem is in the database name...
In database restore it can't process the "-" sign. Try renaming the database and it will work.
 
lol i know this.

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