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.

Backup

Discussion in 'Data Protection' started by Storm3y, Apr 19, 2012.

  1. Storm3y

    Storm3y Member

    Joined:
    Apr 19, 2012
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,


    I'm looking for the best way to backup cPanel accounts.


    I'm looking for a way I can easily take daily backups of accounts and store them for 7 days and preferably incremental to a remote server to save space.

    I looked into cPRemote which seems to do it by rSync however they don't seem to know how long the daily backups are stored for.


    Any of you know the best way to backup?

    Cheers
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,471
    Likes Received:
    199
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. Storm3y

    Storm3y Member

    Joined:
    Apr 19, 2012
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,


    I looked into this. I want to create backups once a day and keep that backup for 7 days. So in total there will be a maximum of the 7 previous days backups on the remote server.


    Can you tell me if thats possible to do that using the built in one for cPanel. I put in a support ticket to cPanel and they where under the impression that it wasn't.


    Cheers.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,471
    Likes Received:
    199
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Curious. Have you got a ticket ID I can peek at?

    If you look at the link posted above, scroll down to the picture of the settings page, you find your answer I think.

    Set it to Daily, disable weekly and monthly, and tick every day of the week. All 7 days. :)

    Configure your remote backup FTP details and you're gold. Of course, incremental backups won't work here though.
     
  5. Storm3y

    Storm3y Member

    Joined:
    Apr 19, 2012
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,


    Here is the ID# 2526663.


    thats what I thought, when I manually ran the script the backups it uploaded weren't time stamped or stored in a daily folder.

    Could you check the settings?


    Cheers
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,471
    Likes Received:
    199
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    On your server? No I can't. My apologies for the confusion added here.

    If you set your backup as I mentioned, your backups will run every night. If you'd like to create a backup of all accounts and have those backups be replaced once every 7 days, select only one day. Instead of all 7 days as I mentioned. Each file has a creation date, but not a time stamp.
     
  7. Storm3y

    Storm3y Member

    Joined:
    Apr 19, 2012
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you for your response. I wanted backups to run every night and store them for 7 days then automatically delete it.

    Seems this isn't possible.

    Do any of you have a script that does an incremental backup via rSync and allows you to restore from the previous 7 days?


    Cheers
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    To perform an incremental backup, you have to be able to file compare with the existing copy. You cannot perform an rsynced incremental backup. You could use the cPanel tool to create an incremental backup, then copy the files (using rsync) to a new folder each day with the date of the backup as part of that folder. Something like this should work if you did a cron to copy them about 12 hours after the backups run:

    Code:
    rsync --archive --verbose --rsh=ssh /backup/cpbackup/daily newserver:/root/backup-`date +"%y-%b-%d"`
    There are a few caveats to running this command by cron:

    1. You'd need to create SSH keys for the machines to be able to log into each other so that you don't have to enter the password.
    2. You'd replace newserver with the SSH login you'd use to reach the new server so root@IP# or whatever you typically use to get to that machine that will be storing the backups.
    3. You'd run the cron on the old machine--the one running the cPanel backup.
    4. You'd replace /root with whatever partition you are placing the new folder.
     
  9. Storm3y

    Storm3y Member

    Joined:
    Apr 19, 2012
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    Does anyone have a bash / shell script that does the following.

    1. Logs into a remote FTP server
    2. Renames a Folder
    3. Deletes a Folder


    I'm going to continue with using the built in cPanel backups as they work quite well. The script would allow me to rename the folder to the day of the week and delete the oldest folder.

    Cheers :)
     
  10. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Is there any reason you don't have at least some form of SSH on that remote machine even jailed? If you did, the issue becomes a lot easier because you can add keys and then don't need to log into it in the same fashion. Logging into a machine using FTP isn't nearly as fast nor as secure as using SSH. If the request changes to this being done via SSH, I can come up with something. I cannot for FTP where it's going to require login credentials, especially since I'm against the whole idea of using FTP for doing it anyway.
     
Loading...

Share This Page