Server Backup using Cron Job

hamed5034

Member
Nov 21, 2013
24
0
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
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.
 

hamed5034

Member
Nov 21, 2013
24
0
1
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.
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
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.
 

hamed5034

Member
Nov 21, 2013
24
0
1
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.
As I understand, "/usr/local/cpanel/bin/backup" is for "Backup"
and "/scripts/cpbackup" is for "Legacy Backup".
Is that true?
 

hamed5034

Member
Nov 21, 2013
24
0
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
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.