Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    May 2005
    Posts
    235

    Default 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.

  2. #2
    Member serversignature's Avatar
    Join Date
    Nov 2007
    Location
    Bangalore
    Posts
    107

    Default

    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
    Last edited by serversignature; 06-06-2009 at 02:27 PM.
    Serversignature.com - Professional Linux Consulting.

  3. #3
    Member
    Join Date
    May 2005
    Posts
    235

    Default

    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?

  4. #4
    Member serversignature's Avatar
    Join Date
    Nov 2007
    Location
    Bangalore
    Posts
    107

    Default

    if you are restoring form the old hard disk .. this should work. which virtual file system in the /home are u talking about.
    Serversignature.com - Professional Linux Consulting.

  5. #5
    Member
    Join Date
    May 2005
    Posts
    235

    Default

    /home/virtfs

  6. #6
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jan 2009
    Posts
    8
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    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.

    --exclude=PATTERN
    OR
    -
    -exclude-from=FILE
    Regards
    Alex Parker
    eUKHOST Dedicated Hosting

  7. #7
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,093
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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/

  8. #8
    Member
    Join Date
    May 2005
    Posts
    235

    Default

    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.

Similar Threads & Tags
Similar threads

  1. rsync Server Backup, Minor Issues After Restore
    By Magotchi in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-16-2011, 04:00 PM
  2. Replies: 0
    Last Post: 01-22-2010, 05:53 PM
  3. Backup alternative: rsync + external server
    By stormrider in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-05-2008, 10:18 PM
  4. Using rsync to enable automatic backup MX mail server domains
    By aarondwyer in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 08-09-2007, 08:48 PM
  5. rsync backup to my local Windows server - what should I install?
    By spaceman in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-26-2006, 05:14 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube