Help - Search - Members - Calendar
Full Version: Plesk Backup System
The Planet Forums > Control Panels > Plesk
SysAdminv001
Hello,

We recently got our first Plesk server after having numerous Ensim Servers and have run into one complication. When we do a Plesk Backup it downs the site and email while the backup is running. Is there a way around that so that the backup process will not cause the site to be disabled? Thankyou.
Squire
The built in system is going to do that to make sure there are no changes being made while the backup is being created.

If you search the Plesk area of the forums here you'll find a thread started by Nighthawk that has a few various of a little backup script that will create sequential backups without stopping any services. Works like a charm.
justin samuel
When using psadump from the command line, the --nostop and --nostop-domain options can be used.

more info (from a 7.5.4 psadump):
CODE
# /usr/local/psa/bin/psadump -h

Usage: /usr/local/psa/bin/psadump [-h] [-F] [-z] -f <dumpfile> [options]



Options:

  -h - This help.

  -F - Make (f)ull dump(it is default option, -C option is not supported now).

  -z - Enable gzip compression for result dump file.

  -f <dumpfile>

      /fullpath/filename - regular file,

      /fullpath/         - dir for dumpfile with default name,

      -                  - use stdout for output,

      ftp://<login>:<password>@<server>/<dumpfile_path> - storing the backup file on remote ftp server.



  --clients-ids    - file with clients ids list which must be dumped;

  --clients-logins - file with clients logins list which must be dumped;

  --domains-ids    - file with domains ids list which must be dumped;

  --domains-names  - file with domains names list which must be dumped;



  --clients-ids-skip    - file with clients ids list which must be skipped during backup;

  --clients-logins-skip - file with clients logins list which must be skipped during backup;

  --domains-ids-skip    - file with domains ids list which must be skipped during backup;

  --domains-names-skip  - file with domains names list which must be skipped during backup;



  --force   - if dumpfile already exists, it will be overwritten

              without prompting

  --version - show version of Backup/Restore utilities

  --nostop  - don't stop services during dump procedure (each domain will be turned off/on)

  --nostop-domain  - don't stop each domain if --nostop is used

  --noblock - do not block backup/restore actions, i.e. allow backup/restore

              actions for other domains at the same time;

  --do-not-dump-logs - do not dump virtual host log files

  --no-internal-zip - don't compress with gzip part of dump file

              (for example: this option disables compression for

              vhosts dirs, mail names);



  --tar-ignore-failed-read - don't exit with non-zero status on

                             unreadable files


Here's an example of its usage, with a file called dump-domains.txt that specifies exactly which domains are to be backed up (with one domain per line in that file):
CODE
/usr/local/psa/bin/psadump -f - --domains-names=/path/to/dump-domains.txt --nostop --nostop-domain --do-not-dump-logs --tar-ignore-failed-read | split -b 1000m - dump.
JLChafardet
--nostop --nostop-domain should do the trick.


as abobe sugested, no man dont split backups, if the target of the backups is a linux system you dont need to split the backup in files. besides is a pain to restore if you are not familiar with the tool.

i would recomend this.

/usr/local/psa/bin/psadump -f /pathtofile/filename --no-internal-zip --nostop --nostop-domain

that being said, if you still want to split the backup, you can just follow the post of justin samuel.

cheers,
Cranky
In Plesk 8 backups don't disable the domains.
bishop4351
This is my little plesk script. It Dumps each domain to it's on psa dump and then bzip's it for compression (sometimes I get greater than 50%). After that it scp's this data over to the other server safe and sound. The process of scping files over also acts as a buffer to allow the load to come down after bziping the backup file. The second post is a companion script that goes with it. This script can be used to monitor the progress of the backup. If you run the backup in cron you can use the second script to check your backup's progress. Also good for other users since it's not really doing anything it's just reading what's going on. Also there is the assumption that you've got an ssh key made for the user you're using scp with.

CODE
#eric's handy plesk backup script.

#check it out on evil-fish!

#v1.2

#last updated 04/04/2006

#!/bin/sh

DATE=$(date +%F)

BACKUP_USER=username

BACKUP_HOST=DOMAIN.tld

BACKUP_DIR=/home/somedir!

LOCAL_BACKDIR=/home/somedir!

################################################

#######PLEASE DO NOT EDIT BELOW THIS LINE#######

################################################

cd $LOCAL_BACKDIR

echo `date` > /tmp/backupstart

echo $DATE > /tmp/backupdir

mkdir $DATE

#priming the pump for scp

scp -r $DATE $BACKUP_USER@$BACKUP_HOST:$BACKUP_DIR

cd $DATE

mysql -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e "select * from domains" |grep -v id|awk '{print $3}' > /tmp/domains

mkdir backup-working

cd backup-working

for domainname in `cat /tmp/domains`; do echo $domainname > $domainname; done

rm  -fr /tmp/domains

cd ..

for domain in `ls backup-working`; do nice /usr/local/psa/bin/psadump -f $domain.$DATE.psadump --do-not-dump-logs --domains-names backup-working/$domain --nostop --nostop-domain --force --no-internal-zip && nice bzip2 -v $domain.$DATE.psadump && scp -r -l 7200  $domain.$DATE.psadump.bz2  $BACKUP_USER@$BACKUP_HOST:$BACKUP_DIR/$DATE; done

rm -fr backup-working

cd ..

rm -f /tmp/backupstart

rm -f /tmp/backupdir


CODE
#!/bin/bash

#This is where all the work gets done

DATE=`cat /tmp/backupdir`

NUMBER=`ls /home/backup/$DATE/|grep -v backup|wc -l|awk '{print $1}'`

TOTAL=`ls /home/backup/$DATE/backup-working/|wc -l| awk '{print $1}'`

SPACE=`du -h --max-depth=1 /home/backup/$DATE/ |grep -v working|awk '{print $1}'`

FILE=`ps aux |grep psadump|grep -v grep|grep perl |awk '{print $14}'`

DOMAIN=`ps aux |grep psadump|grep -v grep|grep perl |awk '{print $14}'|awk '{print $1}' FS="."`

ZIP=`ps ax |grep bzip2|grep -v grep`

XFER=`ps ax |grep scp|grep -v grep|grep -v usr`

#############################################################################

#                     DO NOT EDIT BELOW THIS LINE                           #

#############################################################################

clear

echo " "

echo "_____________________________________________________"

echo "BACKUP STATUS"

echo " "

echo "`echo $NUMBER` out of `echo $TOTAL`"

echo " "

echo "the backup started at:"

cat /tmp/backupstart

echo "it's currently:"

date

echo " "

echo "consuming `echo $SPACE` of space"

echo " "

echo "currently on `echo $FILE` `echo $ZIP` `echo $XFER`"

echo " "

echo "_____________________________________________________"

echo " "

echo "if you'd like to watch this live use 'watch backup-checker.sh'"
JLChafardet
nice script for 7.x, i have one similar, not that complex tho icon_razz.gif, much more simpler.

shame that it wont work on Plesk 8, plesk 8 backup tool is pleskbackup and pleskrestore, which btw, SUCKS BIG TIME.

http://forum.swsoft.com/showthread.php?s=&...&threadid=32448

regards,
bishop4351
I plan on rewriting this for psa8 this weekend.
Mark Priest
Hi Bishop,

Your script looks great, Im having problems with the scp though, ive tried to modify the script to work with FTP but to no avail, can you help?
Mark Priest
Hi Bishop,

I have used your code to do several backups, but how do i restore them to a clean box?
Mark Priest
Mmmm,

Ive created a full backup using the very lame built in tools for version 8, but does this look right?

My total used space on the server is approx 10GB the backup is 2GB?

Does pleskbackup compress it that much, or has it screwed up again?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.