Force the monthly backup to run?

sneader

Well-Known Member
Aug 21, 2003
1,195
68
178
La Crosse, WI
cPanel Access Level
Root Administrator
I accidentally deleted the /cpbackup/monthly folder. Not a biggie, as I have multiple copies of the daily backups, plus the weekly. But I noticed that even after a couple weeks, the monthly has not "run".

What does cpbackup look for, when determining when to copy a weekly into a monthly? Is it the date of the directory and if I changed the date of the directory, "fool it" into copying now?

- Scott
 

sneader

Well-Known Member
Aug 21, 2003
1,195
68
178
La Crosse, WI
cPanel Access Level
Root Administrator
Thanks InfoPro -- I looked at the /scripts/cpbackup script and I can see that --force would bypass the directory timestamp and just "do it".

I wound up changing the script here:

else {
chmod( 0711, "${basedir}/monthly" );
if ( isolderthen( 29, "${basedir}/monthly" ) ) {
backupaccts("${basedir}/monthly");

I just changed 29 to a small number that would cause the monthly to run, then changed it back after the backup ran OK.

I think the only benefit to doing it this way was that it only forced the monthly to be updated, without changing the schedule I have on the weekly.

Thanks for the info on --force! Handy.

- Scott
 

sneader

Well-Known Member
Aug 21, 2003
1,195
68
178
La Crosse, WI
cPanel Access Level
Root Administrator
Hey, that would be best of all!

I look at "man touch" (that command freaks me out LOL) but just want to make sure I am doing this right:

touch -t -c 0902280000 /backup/cpbackup/monthly

Would this change the date of the monthly backup to Feb 28, 2009? And using -c to NOT create any files? I see there is also a -d Date option, but it "accepts a different format" but doesn't say what that format is.

- Scott