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.

Cpbackup --force

Discussion in 'Data Protection' started by fazaha, Mar 16, 2010.

  1. fazaha

    fazaha Member

    Joined:
    Mar 9, 2009
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    hi,

    i wanted to know , how can i config cPanel backups to run in force mod (i mean the cpnackup cronjob) , i want a way that i can enable cpbackup --force every time it runs via cronjob!

    Thanks
     
  2. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
    To force a backup you will have to run /scripts/cpbackup.
     
  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
    As you may or may not know, cPanel does not remove old backups from /backup/cpbackup, even if you terminate a customer. Perhaps this is by design. But in any event, it can waste space over time.

    Tonight I cleaned up some of the backups from old customers. I noticed later that my daily backup did not run. The log says "Daily Backup is up to date". It occurs to me that it must have seen my recent activity in that directory, and assumes that there is no need to run the backup now?

    I tried to re-run /scripts/cpbackup but the same thing occurs.

    Is there a way to truly force the daily backup to run?

    - Scott
     
  4. 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
    OK, I figured it out. I had to change the timestamp on the daily directory, to fool cpbackup into running:

    # touch -t 201003160100.00 /backup/cpbackup/daily
    # /scripts/cpbackup --force

    Works!

    FYI, the touch date/time is in the format of YYYYMMDDhhmm.ss -- the above example is setting the directory timestamp to March 16, 2010 at 1AM.

    - Scott
     
  5. fazaha

    fazaha Member

    Joined:
    Mar 9, 2009
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    But non of these are my answers i want to run --force mode for each cron ;)
     
  6. 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 want a way that i can enable cpbackup --force every time it runs via cronjob!"

    Can you ask the question again, a different way? I do not understand what you want.

    - Scott
     
  7. fazaha

    fazaha Member

    Joined:
    Mar 9, 2009
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Yeap i can say that in other way :
    When we config backups in cPanel it creats a CronJob for it!
    but cPanel runs /scripts/cpbackup , and if it has problems with timestamps , will show us an error that :
    Daily Backup is upto date .

    i am looking for a way that cpanel runs : /scripts/cpbackup --force everytime it wanna run backups!

    did you get it?
     
  8. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    865
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Have you tried editing the cron job ? Like maybe:
    #0 6 * * * /scripts/cpbackup --force
     
  9. 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
    As I mentioned above, when I used --force, it didn't solve the timestamp problem for me.

    I had to manually 'touch' the directory with an older date.

    Fazaha -- why are you having all these problems with backup? I think you should get help for the problem, rather than trying this "work around".

    - Scott
     
Loading...

Share This Page