celiac101

Well-Known Member
Dec 19, 2012
145
5
68
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?
 

quietFinn

Well-Known Member
Feb 4, 2006
1,894
463
438
Finland
cPanel Access Level
Root Administrator
I would like to make my backups use the old method and store them like this:
/backup/cpbackup/daily/sitename.tar.gz
You disable backup in
WHM-> Backup -> Backup Configuration
and enable the legacy backup in
WHM-> Backup-> Legacy Backup Configuration
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
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.
 

celiac101

Well-Known Member
Dec 19, 2012
145
5
68
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
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.