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 Settings

Discussion in 'General Discussion' started by celiac101, Aug 21, 2013.

  1. celiac101

    celiac101 Active Member

    Joined:
    Dec 19, 2012
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    I had to start on a new server recently after a hard disk issue, and my old backup settings put my daily site backups at:
    /backup/cpbackup/daily/sitename.tar.gz

    but now they are going to directories that have date stamps like this:
    /backup/2013-08-21/accounts/sitename.tar.gz

    I would like to make my backups use the old method and store them like this:
    /backup/cpbackup/daily/sitename.tar.gz


    Last, a simple cron to copy a backup and put a date stamp in it that worked on the prior server with the same versions of software on it don't put in the stamp:
    site_backup_`date +"\%Y-\%m-\%d"`.tar.gz
    any idea why this would change?
     
  2. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    You disable backup in
    WHM-> Backup -> Backup Configuration
    and enable the legacy backup in
    WHM-> Backup-> Legacy Backup Configuration
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    The new backup system utilizes directories with the date of the backup generation. Is there a specific reason you prefer the previous directory structure? Also, please paste the full cron job so we can determine why it may not function the same.

    Thank you.
     
  4. celiac101

    celiac101 Active Member

    Joined:
    Dec 19, 2012
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    I need the old system so that I can move a site backup to a different directory and then download it, then delete it. If date stamps are included there is no way to do this properly in an automated way using a cron.

    Here is the cron job which works on another cPanel server I have, and it also was working on the one under discussion, but now won't properly put in the date stamp after the recent rebuild of my server (I replaced my actual site with "sitename"):
    cp -a /backup/cpbackup/daily/sitename.tar.gz /home/sitename/site_backups/sitename_site_backup_`date +"\%Y-\%m-\%d"`.tar.gz
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You would have to develop a bash command that automatically uses the date in the backup directory name. Otherwise, you can disable the new backups and enable legacy backups via:

    "WHM Home >> Backup >> Legacy Backup Configuration"

    Thank you.
     
  6. celiac101

    celiac101 Active Member

    Joined:
    Dec 19, 2012
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Website Owner
    Ok, any idea why that cron job is no longer putting in the date stamp?
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I tested the command you provided and the date aspect works well. It renamed the file to:

    Code:
    sitename_site_backup_\\2013-\\08-\\22.tar.gz
    It will fail if you are attempting to copy a backup file that does not exist. Otherwise, check to see if the date command is working normally on your system on it's own.

    Thank you.
     
Loading...

Share This Page