The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Rsync script for backup of cpanel server

Discussion in 'General Discussion' started by zigzam, Jun 6, 2009.

  1. zigzam

    zigzam Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    206
    Likes Received:
    0
    Trophy Points:
    16
    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. serversignature

    serversignature Well-Known Member

    Joined:
    Nov 26, 2007
    Messages:
    107
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bangalore
    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
     
    #2 serversignature, Jun 6, 2009
    Last edited: Jun 6, 2009
  3. zigzam

    zigzam Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    206
    Likes Received:
    0
    Trophy Points:
    16
    Should the top rsync command be:

    PHP:
    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. serversignature

    serversignature Well-Known Member

    Joined:
    Nov 26, 2007
    Messages:
    107
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bangalore
    if you are restoring form the old hard disk .. this should work. which virtual file system in the /home are u talking about.
     
  5. zigzam

    zigzam Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    206
    Likes Received:
    0
    Trophy Points:
    16
    /home/virtfs
     
  6. eUKAlexP

    eUKAlexP Member
    PartnerNOC

    Joined:
    Jan 12, 2009
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Hello,.

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

    OR
    -
     
  7. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Check out cpmr at http://www.whitedoggreenfrog.com/scripts/
     
  8. zigzam

    zigzam Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    206
    Likes Received:
    0
    Trophy Points:
    16
    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:
    cpmr target:
    Where do I insert the backup host Ip and the port? I dont see a section in the script.
     
Loading...

Share This Page