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.

Force the monthly backup to run?

Discussion in 'Data Protection' started by sneader, Feb 24, 2009.

  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 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
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,472
    Likes Received:
    201
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    You might help it along with this:
    /scripts/cpbackup --force
     
  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
    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
     
  4. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    Or you can just change the date of the monthly folder to be more than 29 days old ... the "touch" command will do that ...
     
  5. 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
    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
     
Loading...

Share This Page