About Us  |  Blog  |  Hosting Partners  |  Legal  |  Portal Login

Welcome Guest ( Log In | Register )

5 Pages V   1 2 3 > »   
Reply to this topicStart new topic
> How to use the plesk backup utilities for running regulary scheduled backups
NightHawk
post Mar 10 2003, 02:25 PM
Post #1


SuperGeek
****

Group: Members
Posts: 1,202
Joined: 12-August 01
Member No.: 23



Ok...I have been asked a few time for a quick and dirty how-to on setting up the
plesk backup utilities for running regulary scheduled backups..

So, here is a very quick and very dirty how-to.

Pre-requisites
1) Plesk Server Administator 5.0.0 or above
2) RedHat 7.1 or above
3) Plesk Backup Utilities installed (you can get these at: https://www.plesk.com/Downloads/utilities.php)


Ok, the rest is simple, just pick the file below that matches your needs and throw it in a cron.
I recommend cron.daily, but adjust as needed to fit your taste.

Each of these will keep 3 backups and rotate them accordingly.
Directory Dump1 will be the most current, and Dump3 the least current backup.

**note: I am using --nostop --tar-ignore-failed-read, which means these may not be 100% complete backups.**
**If you need a one-shot backup becuase you are de-installing plesk run the commmands without those tags.**


1) login to your server via ssh..and su - to root.
2) cd /etc/cron.daily
3) vi zzbackup.sh
4) enter insert mode (i) paste in whichever one of the below match your requirements.
5) exit vi ( icon_mad.gif )
6) chmod 755 /etc/cron.daily/zzbackup.sh

[PHP]
#####
###local backups
###put this script in cron.daily
#####
#!/bin/bash
/bin/rm -Rf /dump3
/bin/mv /dump2 /dump3
/bin/mv /dump1 /dump2
/bin/mkdir /dump1
cd /dump1
/usr/local/psa/bin/psadump -F -f - --nostop --tar-ignore-failed-read | split -b 1000m - dump.
####################################
###end of include###################
####################################
[/PHP]

[PHP]
#####
###local backups with gzip
###put this script in cron.daily
#####
#!/bin/bash
/bin/rm -Rf /dump3
/bin/mv /dump2 /dump3
/bin/mv /dump1 /dump2
/bin/mkdir /dump1
cd /dump1
/usr/local/psa/bin/psadump -F -f - --nostop --tar-ignore-failed-read | gzip | split -b 1000m - dump.

####################################
###end of include###################
####################################
[/PHP]

[PHP]
#####
###local backups on a box with 2 HD's
###put this script in cron.dail
###must have 2nd HD mounted as /home2 for this to work
#####
#!/bin/bash
/bin/rm -Rf /home2/dump3
/bin/mv /home2/dump2 /home2/dump3
/bin/mv /home2/dump1 /home2/dump2
/bin/mkdir /home2/dump1
cd /home2/dump1
/usr/local/psa/bin/psadump -F -f - --nostop --tar-ignore-failed-read | split -b 1000m - dump.

####################################
###end of include###################
####################################
[/PHP]

[PHP]
#####
###local backups on a box with 2 HD's
###put this script in cron.daily
###must have 2nd HD mounted as /home2 for this to work
#####
#!/bin/bash
/bin/rm -Rf /home2/dump3
/bin/mv /home2/dump2 /home2/dump3
/bin/mv /home2/dump1 /home2/dump2
/bin/mkdir /home2/dump1
cd /home2/dump1
/usr/local/psa/bin/psadump -F -f - --nostop --tar-ignore-failed-read | gzip | split -b 1000m - dump.

####################################
###end of include###################
####################################[/PHP]


--------------------
NightHawk
We Make Server Management Easy!
http://www.easyservermanagement.com
Go to the top of the page
 
+Quote Post
NightHawk
post Mar 10 2003, 02:27 PM
Post #2


SuperGeek
****

Group: Members
Posts: 1,202
Joined: 12-August 01
Member No.: 23



To restore the backups, if needed, use the following block that matches your needs.
You will have to edit the map_file and possibly the shells_map_file if you are not restoring on the box your pulled the backup from.

(the directories used in these restores are the defualt ones..be sure to change /psadumps to the path to the directory that holds the backups you want to restore)

[PHP]
#####
###restore procedure
### for gzip backups
#####
cd /psadumps
cat dump.* | gzip -d | /usr/local/psa/bin/psarestore -m map_file -s shells_map_file -f -
vi map_file
vi shells_map_file
cat dump.* | gzip -d | /usr/local/psa/bin/psarestore -m map_file -s shells_map_file -f -
####################################
###end of include###################
####################################
[/PHP]


[PHP]
#####
###restore procedure
###for non-gzip backups
#####
cd /psadumps
cat dump.* | /usr/local/psa/bin/psarestore -m map_file -s shells_map_file -f -
vi map_file
vi shells_map_file
cat dump.* | /usr/local/psa/bin/psarestore -m map_file -s shells_map_file -f -
####################################
###end of include###################
####################################
[/PHP]


--------------------
NightHawk
We Make Server Management Easy!
http://www.easyservermanagement.com
Go to the top of the page
 
+Quote Post
Guest_GlobalPN_*
post Mar 10 2003, 11:28 PM
Post #3





Guests






RPM 5.0.5 allready contains the backup utility along with it correct? I've been told this by RackShack people and would just like to clarify it once again. Thanks NightHawk you saved us all icon_smile.gif.
Go to the top of the page
 
+Quote Post
NightHawk
post Mar 10 2003, 11:51 PM
Post #4


SuperGeek
****

Group: Members
Posts: 1,202
Joined: 12-August 01
Member No.: 23



QUOTE
Originally posted by GlobalPN
RPM 5.0.5 allready contains the backup utility along with it correct? I've been told this by RackShack people and would just like to clarify it once again. Thanks NightHawk you saved us all icon_smile.gif.


as far as I know....unless RS has added them to thier image (which is possible) you have to install the plesk backup utitlities yourself.


--------------------
NightHawk
We Make Server Management Easy!
http://www.easyservermanagement.com
Go to the top of the page
 
+Quote Post
Guest_GlobalPN_*
post Mar 11 2003, 04:07 PM
Post #5





Guests






ok, is there a tutorial on how to install this using ssh? Also how would I delete the current one I made?
Go to the top of the page
 
+Quote Post
NightHawk
post Mar 11 2003, 04:22 PM
Post #6


SuperGeek
****

Group: Members
Posts: 1,202
Joined: 12-August 01
Member No.: 23



QUOTE
Originally posted by GlobalPN
ok, is there a tutorial on how to install this using ssh? Also how would I delete the current one I made?


all of the above is done via ssh. I have not put together a how-to for installing the actual plesk backup utilites, but that is becuase they are extemely self-explanitory, just go download them to the server (wget) for plesk, unpack the tar.gz...and run the .sh that comes with it....they come with a .txt file that explains all of that.


--------------------
NightHawk
We Make Server Management Easy!
http://www.easyservermanagement.com
Go to the top of the page
 
+Quote Post
Guest_GlobalPN_*
post Mar 17 2003, 12:04 AM
Post #7





Guests






How do you exit the vi? I have tried to do this but have not been successful. Thanks for your help with everything.
Go to the top of the page
 
+Quote Post
Gentle Giant
post Mar 17 2003, 06:10 AM
Post #8


Techie
**

Group: Members
Posts: 274
Joined: 6-December 02
Member No.: 5,151



Thanks for this - getting a message when running that says...

Some errors can be occured during restoration hosting directories or mailnames because --tar-ignore-failed_read and --nostop keys was used at the same time.

Anything to be concerned about?
Go to the top of the page
 
+Quote Post
Gentle Giant
post Mar 17 2003, 06:37 AM
Post #9


Techie
**

Group: Members
Posts: 274
Joined: 6-December 02
Member No.: 5,151



Also (unless I am being thick!)

In the restore you say

cd /pasdumps

I assume you mean

cd /psadumps

yet in the original backup the dumps are done to the root in /dump1 /dump2 /dump3

Just wondering if we have the odd typo.

Take care.
Go to the top of the page
 
+Quote Post
NightHawk
post Mar 17 2003, 08:26 AM
Post #10


SuperGeek
****

Group: Members
Posts: 1,202
Joined: 12-August 01
Member No.: 23



QUOTE
Originally posted by GlobalPN
How do you exit the vi? I have tried to do this but have not been successful. Thanks for your help with everything.


:q <--- quit
:q! <--- quit without saving after making changes
icon_mad.gif <--- quit and save


--------------------
NightHawk
We Make Server Management Easy!
http://www.easyservermanagement.com
Go to the top of the page
 
+Quote Post
NightHawk
post Mar 17 2003, 08:28 AM
Post #11


SuperGeek
****

Group: Members
Posts: 1,202
Joined: 12-August 01
Member No.: 23



QUOTE
Originally posted by Gentle Giant
Thanks for this - getting a message when running that says...

Some errors can be occured during restoration hosting directories or mailnames because --tar-ignore-failed_read and --nostop keys was used at the same time.

Anything to be concerned about?


Only worry about this..if you are using this for a one shot backup...and restoring your server.....

the --nostop makes it to where the servers services (apache, psa, etc) don't stop during backup...this can cause some corrupted files, but if you are running it daily like I set this up for..you won't want all your services stopping all time...and odds are...any messed up files would be in another backup..


--------------------
NightHawk
We Make Server Management Easy!
http://www.easyservermanagement.com
Go to the top of the page
 
+Quote Post
NightHawk
post Mar 17 2003, 08:29 AM
Post #12


SuperGeek
****

Group: Members
Posts: 1,202
Joined: 12-August 01
Member No.: 23



QUOTE
Originally posted by Gentle Giant
Also (unless I am being thick!)

In the restore you say  

cd /pasdumps

I assume you mean

cd /psadumps

yet in the original backup the dumps are done to the root in /dump1 /dump2 /dump3

Just wondering if we have the odd typo.

Take care.


Hrm...I don't see what you are talking about cool.gif

(ahh..the edit button is a good thing...thanks for pointing that out)


--------------------
NightHawk
We Make Server Management Easy!
http://www.easyservermanagement.com
Go to the top of the page
 
+Quote Post
nacarls
post Mar 26 2003, 09:02 PM
Post #13


Fellow
**

Group: Members
Posts: 130
Joined: 30-September 02
Member No.: 4,179



I get this error when trying to restore. The sites were backed up with the 2.5.1 util then i upgraded to plesk 5 and tried to restart with the 5.0.5 util. Here is my errors:

CODE
[root@www plesk]# cat dump_file | gzip -d | /usr/local/psa/bin/psarestore -m map_file -s shells_map_file -f -



gzip: stdin: not in gzip format



===============================================================================



Attempt to connect to MySQL server ... done



===============================================================================



Input file is not a valid MIME file: can not find MIME header.


Any info on this would be appreciated icon_neutral.gif
Go to the top of the page
 
+Quote Post
NightHawk
post Mar 26 2003, 09:10 PM
Post #14


SuperGeek
****

Group: Members
Posts: 1,202
Joined: 12-August 01
Member No.: 23



looks like you didn't use the g-zip tag when you did the dump...so you might want to remove it from your restore line:

| gzip -d


--------------------
NightHawk
We Make Server Management Easy!
http://www.easyservermanagement.com
Go to the top of the page
 
+Quote Post
nacarls
post Mar 26 2003, 09:59 PM
Post #15


Fellow
**

Group: Members
Posts: 130
Joined: 30-September 02
Member No.: 4,179



ugh sorry for the fuss but i hit another problem.

Unable to add a system user ''username'':Error: empty argument HomeDir
Error occured during preparation for the object restoring.
Unable to retrieve necessary info on the destination directory location for the content restoring for object domain.

Im assuming this is due to the useradd commands and they are not set in the dump file correctly. Any way to fix this? It looks like the database has been installed successfully and just hangs after the users are failed. thanks for the help
Go to the top of the page
 
+Quote Post
NightHawk
post Mar 26 2003, 10:01 PM
Post #16


SuperGeek
****

Group: Members
Posts: 1,202
Joined: 12-August 01
Member No.: 23



QUOTE
Originally posted by nacarls
ugh sorry for the fuss but i hit another problem.  

Unable to add a system user ''username'':Error: empty argument HomeDir
Error occured during preparation for the object restoring.
Unable to retrieve necessary info on the destination directory location for the content restoring for object domain.

Im assuming this is due to the useradd commands and they are not set in the dump file correctly. Any way to fix this? It looks like the database has been installed successfully and just hangs after the users are failed. thanks for the help


hrm...that's one I havn't seen....

check the release notes for the backup utlities...it explains how to deal with "collosions" ...hopefully you can make something similar work for this...

(and post back with how you did it..when you figure it out cool.gif )


--------------------
NightHawk
We Make Server Management Easy!
http://www.easyservermanagement.com
Go to the top of the page
 
+Quote Post
nacarls
post Mar 26 2003, 10:29 PM
Post #17


Fellow
**

Group: Members
Posts: 130
Joined: 30-September 02
Member No.: 4,179



NightHawk,

I do have a tarball of the entire psa directory. If i was to just extract this somewhere else theoretically couldnt I just mv the domain folder into the /usr/local/psa/home/vhosts/ folder minding that i stay away from default and webmail? The databases were setup correct...but the users were not. Quite frankly I have done something I didnt want to do...I became a statistic. Any help would deeply be appreciated at the point in time.
Go to the top of the page
 
+Quote Post
NightHawk
post Mar 26 2003, 10:33 PM
Post #18


SuperGeek
****

Group: Members
Posts: 1,202
Joined: 12-August 01
Member No.: 23



QUOTE
Originally posted by nacarls
NightHawk,  

I do have a tarball of the entire psa directory. If i was to just extract this somewhere else theoretically couldnt I just mv the domain folder into the /usr/local/psa/home/vhosts/ folder minding that i stay away from default and webmail? The databases were setup correct...but the users were not. Quite frankly I have done something I didnt want to do...I became a statistic. Any help would deeply be appreciated at the point in time.


might work...might not....if the psa db is intact...and all the config files are intact...that would work....if not..it won't.


--------------------
NightHawk
We Make Server Management Easy!
http://www.easyservermanagement.com
Go to the top of the page
 
+Quote Post
nacarls
post Mar 26 2003, 10:43 PM
Post #19


Fellow
**

Group: Members
Posts: 130
Joined: 30-September 02
Member No.: 4,179



my problem is this...the back didnt work. Which really burst my bubbles. If i reinstall the 2.5.5 standard and use my tar file to restore. would my plesk key still be on it?
Go to the top of the page
 
+Quote Post
NightHawk
post Mar 26 2003, 10:49 PM
Post #20


SuperGeek
****

Group: Members
Posts: 1,202
Joined: 12-August 01
Member No.: 23



QUOTE
Originally posted by nacarls
my problem is this...the back didnt work. Which really burst my bubbles. If i reinstall the 2.5.5 standard and use my tar file to restore. would my plesk key still be on it?



probably not. It might have stayed...but it is not likely. You will probably need to re-install the plesk key.


--------------------
NightHawk
We Make Server Management Easy!
http://www.easyservermanagement.com
Go to the top of the page
 
+Quote Post

5 Pages V   1 2 3 > » 
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st November 2009 - 04:15 PM
 

Dedicated Servers

Managed Hosting

Colocation

Business Solutions

Why The Planet?

Contact Us