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.

Incremental or FTP Backups? Why not BOTH?

Discussion in 'Data Protection' started by sneader, Nov 9, 2008.

  1. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    I believe incremental backups to a local drive is the fastest and easiest
    way to do backups, and it works very well (thank you cPanel!)

    However, for safety, I would sleep better if I had backups on a remote FTP
    server, at least once per week.

    In fact, my data center offers 50GB of backup space on their off-site FTP
    server at no extra charge.

    The problem is... how to utilize it???

    I do not want to stop doing incremental backups.

    I cannot just FTP the incremental backups (i.e. /backup/cpbackup/daily) because I would lose file ownership and permissions.

    What I really need is a way to occasionally switch to FTP Backup mode, and let pkgacct make some nice tar.gz files of each account and have them FTP'd to the Remote FTP server. Perhaps weekly.

    Any ideas?

    I put in a Feature Enhancement Request in with cPanel. If you'd like to add comments, vote, etc., see http://bugzilla.cpanel.net/show_bug.cgi?id=8057

    - Scott
     
  2. haxxor23

    haxxor23 Member

    Joined:
    Nov 4, 2008
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    why don't you just use rsync? it's very good, and preserves file ownership too. you can set it up to run in crons for a weekly task for example.

    I have one running everyday, just after my cpanel backups complete.
     
  3. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    ... because my data center only provides FTP backups, with no option for rsync. :(

    - Scott
     
  4. haxxor23

    haxxor23 Member

    Joined:
    Nov 4, 2008
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    well, then just get an off site backup at a different datacenter .... they only cost about 50 cents per gigabyte per month ..... and besides, your data is safer being stored in another location...
     
  5. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The quickest (and untested) method I can think of doing this is to have two backup configurations. One for the Incremental, the other for the FTP. I think you also need a separate location to store the FTP archives before transmitting.

    Set a cron job to run a few minutes before backup actually starts. The job could check the day of the week and swap out the backup configuration files depending upon the day. This way you could run Incremental Mon - Sat and FTP on Sunday, as an example.

    Doing it this way will lessen the load on your server. The other way that came to mind was to have /scripts/postcpbackup swap the backup configurations and re-run the backup.
     
  6. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    Thanks Kenneth... I actually thought about this, but did not know where the backup configurations were stored?

    - Scott
     
  7. rrwh

    rrwh Well-Known Member

    Joined:
    Oct 2, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    How about this as a much more elegant solution:

    make use of the /scripts/postcpbackup functionality.

    write yourself a script that does the following:

    checks when the last /backup/cpbackup/weekly was run,

    tar up the weekly directory if it was run within the last 24 hours and then ftp the tar of the weekly directory offsite.

    This is a simple 10-20 line shell script and makes what you want to do trivial.

    hint:

    find /backup/cpbackup/weekly -mtime 0

    is a great test to identify the files that have changed within the last 24 hours.

    If files have changed, then tar them up and ftp them over.

    hint2:

    man netrc to learn how to do an automated ftp transfer.

    If you can't write a script to do this from the hints I have given, then feel free to contact me and I'll give you a price :)
     
  8. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    Thanks for the feedback and ideas (and offer to help).

    I have done some testing with FTP (just using the built-in cPanel FTP backup feature) and am concerned about the load on the server and length of time it takes.

    I have another idea, which will use rsync instead of FTP, which should keep the load down and length of time down, since only changed files will be copied.

    If it doesn't pan out, I may hit you up for help with the script!

    Thanks again!

    - Scott
     
Loading...

Share This Page