#1 (permalink)  
Old 06-06-2009, 11:59 AM
Registered User
 
Join Date: May 2005
Posts: 221
zigzam is on a distinguished road
Rsync script for backup of cpanel server

Does anyone know of a rsync script that will backup all the important directories that need to be restored in the event of a server failure.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-06-2009, 12:42 PM
serversignature's Avatar
Registered User
 
Join Date: Nov 2007
Location: Bangalore
Posts: 94
serversignature is on a distinguished road
to be restored in the event of a server failure.

Code:
rsync -vrplogDtH secondarymx domainalias valiases vfilters exim* proftpd* pure-ftpd* passwd* group* *domain* *named* wwwacct.conf cpupdate.conf quota.conf shadow* *rndc* ips* ipaddrpool* ssl  /etc


rsync -vrplogDtH /mnt/old/usr/local/apache/conf /usr/local/apache
rsync -vrplogDtH /mnt/old/var/named /var
rsync -vrplogDtH /mnt/old/home/* /home
rsync -vrplogDtH /mnt/old/usr/local/cpanel /usr/local
rsync -vrplogDtH /mnt/old/var/lib/mysql /var/lib
rsync -vrplogDtH /mnt/old/var/cpanel /var
rsync -vrplogDtH /mnt/old/usr/share/ssl /usr/share
rsync -vrplogDtH /mnt/old/var/ssl /var
rsync -vrplogDtH /mnt/old/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
rsync -vrplogDtH /mnt/old/var/log/bandwidth /var/log
rsync -vrplogDtH /mnt/old/usr/local/frontpage /usr/local
rsync -vrplogDtH /mnt/old/var/spool/cron /var/spool

-v, –verbose increase verbosity
-r, –recursive recurse into directories
-l, –links copy symlinks as symlinks
-o, –owner preserve owner (super-user only)
-g, –group preserve group
-D same as –devices –specials
-t, –times preserve modification times
-H, –hard-links preserve hard links
__________________
Kiran
Serversignature.com
Freelance Linux Admin

Last edited by serversignature; 06-06-2009 at 02:27 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-06-2009, 01:38 PM
Registered User
 
Join Date: May 2005
Posts: 221
zigzam is on a distinguished road
Should the top rsync command be:

PHP Code:
rsync -vrplogDtH /mnt/old/etcsecondarymx domainalias valiases vfilters eximproftpdpure-ftpdpasswdgroup* *domain* *namedwwwacct.conf cpupdate.conf quota.conf shadow* *rndcipsipaddrpoolssl /etc 

Also does the virtual file system in the /home directory need to be backed up or can that be excluded?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-06-2009, 02:32 PM
serversignature's Avatar
Registered User
 
Join Date: Nov 2007
Location: Bangalore
Posts: 94
serversignature is on a distinguished road
if you are restoring form the old hard disk .. this should work. which virtual file system in the /home are u talking about.
__________________
Kiran
Serversignature.com
Freelance Linux Admin
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-06-2009, 02:44 PM
Registered User
 
Join Date: May 2005
Posts: 221
zigzam is on a distinguished road
/home/virtfs
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-07-2009, 05:44 PM
Registered User
 
Join Date: Jan 2009
Posts: 4
eUKAlexP is on a distinguished road
Quote:
Originally Posted by zigzam View Post
/home/virtfs
Hello,.

Please don't take backup of /home/virtfs directory , put this directory in exclude list using following option in rsync command.

Quote:
--exclude=PATTERN
OR
-
Quote:
-exclude-from=FILE
__________________
Thanks and Regards
Alex P
http://www.eukhost.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 06-08-2009, 11:34 AM
brianoz's Avatar
Registered User
 
Join Date: Mar 2004
Location: Melbourne, Australia
Posts: 984
brianoz is on a distinguished road
Quote:
Originally Posted by zigzam View Post
Does anyone know of a rsync script that will backup all the important directories that need to be restored in the event of a server failure.
Check out cpmr at http://www.whitedoggreenfrog.com/scripts/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 06-08-2009, 02:54 PM
Registered User
 
Join Date: May 2005
Posts: 221
zigzam is on a distinguished road
Quote:
Originally Posted by brianoz View Post
I tried out that script, but cant figure out how to get the remote backup to work. My remote backup server is on a non standard port.

It says to run
PHP Code:
cpmr target
Where do I insert the backup host Ip and the port? I dont see a section in the script.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup alternative: rsync + external server stormrider cPanel and WHM Discussions 1 02-05-2008 10:18 PM
Using rsync to enable automatic backup MX mail server domains aarondwyer cPanel and WHM Discussions 3 08-09-2007 08:48 PM
rsync backup to my local Windows server - what should I install? spaceman cPanel and WHM Discussions 1 10-26-2006 05:14 PM
rsync://rsync.cpanel.net broken? Sinewy cPanel and WHM Discussions 7 10-26-2004 07:08 AM
while doing updatenow:rsync: getaddrinfo: rsync.cpanel.net 873: Temporary failure ehpserver cPanel and WHM Discussions 0 01-25-2004 05:02 PM


All times are GMT -5. The time now is 04:24 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc