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.

Set day when Weekly backup should run

Discussion in 'General Discussion' started by never2far, Jun 28, 2011.

  1. never2far

    never2far Active Member

    Joined:
    May 6, 2008
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    Is there any way i can set in WHM the day that weekly backup will start(for example Sunday, or Monday) so that on the same day, every week, the weekly backup will be replaced with the new one ?

    One solution I have found is here but the topic is old and maybe now cPanel have this option: http://forums.cpanel.net/f5/whm-backup-43683.html

    I know there are few topics about this but i haven't found an answer from other topics, so if i missed something please don't get angry and point to the correct page...thank you.
     
  2. fi77i

    fi77i Well-Known Member

    Joined:
    Aug 20, 2008
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Uruguay
    cPanel Access Level:
    Root Administrator
    You can go to the root crontab and set the day there for the cpbackup cronjob.
    Or you can set it in the whm backup configuration.

    Here is the documentation.

    Configure Backup
     
    #2 fi77i, Jun 28, 2011
    Last edited: Jun 28, 2011
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,460
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    There is a plugin called cronconfig that you can install from:
    WHM > cPanel > Manage Plugins, cronconfig. It can be installed easy enough, and will allow you to edit the time the cronjob runs for upcp and cpbackup.

    And you can change your backup settings from:
    WHM > Backup > Configure Backup, section.

    The above take care of the time backup should run.

    I can't tell you if chirpy's script (in that post you linked) is still workable or if this one, for rotating backups though:
    NDCHost - Clean Backups plug-in for cPanel/WHM
     
  4. never2far

    never2far Active Member

    Joined:
    May 6, 2008
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Thanks for the quick response.

    For what I understand, if I change the time when cpbackup will run, it will affect also day when daily backup will be done.

    For example if i want weekly backup to be done on each Monday(day 1 - Weekday is the day of the week you want it to run on 0=Sunday and 6=Saturday) and daily backups to be completed each day of the week, I don't understand how can this can be modified in cron since cpbackup is used for both weekly and daily backups.

    If I'm wrong please correct me.

    Thank you
     
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,460
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Not sure I follow you here, my apologies. Just under the Backup Interval settings in the Configure Backup section of WHM there's the Backup Retention setting. I'm not sure editing the cron from the plugin is what you're looking for.
     
  6. mikelegg

    mikelegg Well-Known Member

    Joined:
    Mar 29, 2005
    Messages:
    330
    Likes Received:
    0
    Trophy Points:
    16
    There is no native ability in cPanel to specify on what day of the week you want the weekly or monthly backups to run if you are running daily backups every day.

    It is a feature that has been requested for a long time.
     
  7. mikelegg

    mikelegg Well-Known Member

    Joined:
    Mar 29, 2005
    Messages:
    330
    Likes Received:
    0
    Trophy Points:
    16
    Although this plugin allows you to set the time that cpbackup runs each day, it's doesn't allow you to specify on which day of the week the weekly or monthly backups will run.
     
  8. mikelegg

    mikelegg Well-Known Member

    Joined:
    Mar 29, 2005
    Messages:
    330
    Likes Received:
    0
    Trophy Points:
    16
    Here's one of the many threads where this has been brought up in the past http://forums.cpanel.net/f334/align-weekly-monthly-backups-specific-day-week-specific-day-month-143901.html

    The thread has been closed because the hardlinking feature has supposedly dealt with the problem.

    I just enabled the experimental (?) hardlinking feature on my biggest server which can take up to 12 hours to do a weekly/monthly backup and I'll see if it makes any difference.

    I personally would like to see the same configuration options that are available in Enkompass so that I can control the exact days that weekly/monthly backups are created.
     
    #8 mikelegg, Jun 29, 2011
    Last edited: Jun 29, 2011
  9. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You could always cron copy the existing backups with a secondary cron job that simply copies the existing daily backups on a weekly or monthly basis without having weekly and monthly backups retained or created (by unchecking weekly and monthly in WHM > Backup > Configure Backup > Backup Retention field). The following cron would work for weekly to copy the existing daily data:

    Code:
    0 1 * * 6 /bin/cp -R /backup/cpbackup/daily/* /backup/cpbackup/weekly/
    You would need to create the weekly folder if it doesn't already exist:

    Code:
    mkdir -p /backup/cpbackup/weekly
    This would be different than a hardlink as it would actually contain the data and not be linking to the daily data. This would run the cron at 1:00am server time on Saturdays.
     
Loading...

Share This Page