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.

Server Backup using Cron Job

Discussion in 'Data Protection' started by hamed5034, Nov 21, 2013.

  1. hamed5034

    hamed5034 Member

    Joined:
    Nov 21, 2013
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    I am using cPanel 11.40.0 and I want to configure backup using "Configure cPanel Cron Jobs".
    As I see, I can configure only time of backup, Minute, Hour, Day, Month, Weekday
    Please tell me what should I do for configuring FTP details?
    I want to configure a weekly backup, every Tuesday, at 3:00 AM.

    Thanks.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    The actual backup configuration is completed at:

    "WHM Home » Backup » Backup Configuration"

    You can modify the time of the backup generation by modifying the "/usr/local/cpanel/bin/backup" cron job via the command line:

    Code:
    crontab -e
    Thank you.
     
  3. hamed5034

    hamed5034 Member

    Joined:
    Nov 21, 2013
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello Michael,

    Thanks for your answer.
    In "Configure cPanel Cron Jobs" we can configure a cron job for running backup using "Command: cpbackup" section.
    Please tell me is this cron job for "Backup" or "Legacy Backup" ?

    Thanks in advance.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    That is the cron job for the legacy backup script. The new backup script is not yet listed in the "Cron Config" plugin, however there are plans to include it in a future build of cPanel.

    Thank you.
     
  5. hamed5034

    hamed5034 Member

    Joined:
    Nov 21, 2013
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    As I understand, "/usr/local/cpanel/bin/backup" is for "Backup"
    and "/scripts/cpbackup" is for "Legacy Backup".
    Is that true?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, that is correct.

    Thank you.
     
  7. hamed5034

    hamed5034 Member

    Joined:
    Nov 21, 2013
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    The output of crontab -e command is:
    Code:
    2,58 * * * * /usr/local/bandmin/bandmin
    0 0 * * * /usr/local/bandmin/ipaddrmap
    0 6 * * * /usr/local/cpanel/scripts/exim_tidydb > /dev/null 2>&1
    30 5 * * * /usr/local/cpanel/scripts/optimize_eximstats > /dev/null 2>&1
    12 4 * * * /usr/local/cpanel/scripts/upcp --cron
    35 * * * * /usr/bin/test -x /usr/local/cpanel/bin/tail-check && /usr/local/cpan$
    45 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_mailman_cache &&$
    30 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr$
    45 */8 * * * /usr/bin/test -x /usr/local/cpanel/bin/optimizefs && /usr/local/cp$
    30 */2 * * * /usr/local/cpanel/bin/mysqluserstore >/dev/null 2>&1
    15 */2 * * * /usr/local/cpanel/bin/dbindex >/dev/null 2>&1
    15 */6 * * * /usr/local/cpanel/scripts/autorepair recoverymgmt >/dev/null 2>&1
    */5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1
    58 2 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
    5,20,35,50 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
    0 18 * * * /usr/local/cpanel/3rdparty/attracta/scripts/update-attracta --from-c$
    36 * * * * /usr/local/cpanel/3rdparty/attracta/scripts/get_jobs.pl > /dev/null $
    * * * * * /usr/local/cpanel/3rdparty/attracta/scripts/daily_jobs.pl > /dev/null$
    0 1 * * * /usr/local/cpanel/scripts/cpbackup
    0 0 * * 6 /usr/local/cpanel/bin/backup
    
    It means that "Backup" process begins in 00:00 at every Friday. Is that true?
    Server time is "Fri Nov 22 00:30:20" now, but backup does not start.
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You can update the cron job to the following if you want it to run at 3:00AM each day:

    Code:
    0 3 * * * /usr/local/cpanel/bin/backup
    Note that you should adjust the retention on the backup generation page itself. The cron job should run every day, regardless of your retention and generation settings.

    Thank you.
     
Loading...

Share This Page