Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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,155
    Likes Received:
    39
    Trophy Points:
    178
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,467
    Likes Received:
    419
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    You might help it along with this:
    /scripts/cpbackup --force
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,155
    Likes Received:
    39
    Trophy Points:
    178
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    168
    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 ...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,155
    Likes Received:
    39
    Trophy Points:
    178
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice