Question
What are the default cPanel cron jobs and what is their purpose?
Answer
When listing all of your cron jobs, you will most likely see something similar to the jobs below. This is because these are the default cPanel cron jobs as per version 90.0 (build 3):
40 21 * * * (/usr/local/cpanel/scripts/fix-cpanel-perl; /usr/local/cpanel/scripts/upcp --cron > /dev/null)
0 2 * * * /usr/local/cpanel/bin/backup
35 * * * * /usr/bin/test -x /usr/local/cpanel/bin/tail-check && /usr/local/cpanel/bin/tail-check
0 6 * * * /usr/local/cpanel/scripts/exim_tidydb > /dev/null 2>&1
30 5 * * * /usr/local/cpanel/scripts/optimize_eximstats > /dev/null 2>&1
22 22 * * 7 /usr/local/cpanel/scripts/send_api_notifications > /dev/null 2>&1
5,20,35,50 * * * * /usr/local/cpanel/scripts/eximstats_spam_check 2>&1
45 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_mailman_cache && /usr/local/cpanel/scripts/update_mailman_cache
15 */6 * * * /usr/local/cpanel/scripts/autorepair recoverymgmt >/dev/null 2>&1
*/5 * * * * /usr/local/cpanel/scripts/dcpumon-wrapper >/dev/null 2>&1
0 */2 * * * /usr/local/cpanel/scripts/shrink_modsec_ip_database -x 2>&1
11 22 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
30 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache
25 */2 * * * /usr/local/cpanel/bin/mysqluserstore >/dev/null 2>&1
15 */2 * * * /usr/local/cpanel/bin/dbindex >/dev/null 2>&1
09,39 * * * * /usr/local/cpanel/scripts/clean_user_php_sessions > /dev/null 2>&1
1,16,31,46 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
@reboot /usr/local/cpanel/bin/onboot_handler
29 23 * * * /usr/local/cpanel/3rdparty/bin/freshclam --quiet --no-warnings
Looking at these cron jobs might not make much sense at first glance, however, if you have any doubts regarding each cronjob you can find their purpose below. The description of each job is ordered from top to bottom.
Some of the jobs utilize the test (/usr/bin/test) utility evaluates the condition and indicates the result of the evaluation by its exit status. An exit status of zero indicates that the condition evaluated as true and an exit status of 1 indicates that the condition evaluated as false. These types of jobs tests whether X exists and is executable. If it is, then it runs X. Examples of these can be found below such as /usr/local/cpanel/bin/tail-check.
40 21 * * * (/usr/local/cpanel/scripts/fix-cpanel-perl; /usr/local/cpanel/scripts/upcp --cron > /dev/null)
- /usr/local/cpanel/scripts/fix-cpanel-perl:
-
If you see any errors that mention Perl on your cPanel installation, this is most likely the script you want to run as it will attempt to update and fix any Perl issue.
-
- /usr/local/cpanel/scripts/upcp --cron:
- The script updates cPanel & WHM. The --cron option tells the script to follow WHM's Update Preferences (/etc/cpupdate.conf).
0 2 * * * /usr/local/cpanel/bin/backup
- /usr/local/cpanel/bin/backup:
-
This script runs a manual backup in WHM via the command line. For more information, read our backup script documentation.
-
35 * * * * /usr/bin/test -x /usr/local/cpanel/bin/tail-check && /usr/local/cpanel/bin/tail-check
- /usr/local/cpanel/bin/tail-check:
- This job tests whether /usr/local/cpanel/bin/tail-check exists and is executable. If it is, then it runs /usr/local/cpanel/bin/tail-check.
0 6 * * * /usr/local/cpanel/scripts/exim_tidydb > /dev/null 2>&1
- /usr/local/cpanel/scripts/exim_tidydb:
- Cleans the exim message log.
30 5 * * * /usr/local/cpanel/scripts/optimize_eximstats > /dev/null 2>&1
- /usr/local/cpanel/scripts/optimize_eximstats:
- This script is used to vacuum (defragment) the eximstats database.
22 22 * * 7 /usr/local/cpanel/scripts/send_api_notifications > /dev/null 2>&1
- /usr/local/cpanel/scripts/send_api_notifications:
- This script queries the cPanel API1 usage logs for the period since it was last run and sends a report of the top 5 pages with cPanel API1 calls for that period.
5,20,35,50 * * * * /usr/local/cpanel/scripts/eximstats_spam_check 2>&1
- /usr/local/cpanel/scripts/eximstats_spam_check:
- This script is used to query the eximstats database, and report possible
spammers.
- This script is used to query the eximstats database, and report possible
45 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_mailman_cache && /usr/local/cpanel/scripts/update_mailman_cache
- /usr/local/cpanel/scripts/update_mailman_cache:
- Forces to updates the mailman cache.
15 */6 * * * /usr/local/cpanel/scripts/autorepair recoverymgmt >/dev/null 2>&1
- /usr/local/cpanel/scripts/autorepair:
- cPanel autorepair Script, it fixes common known issues withing cPanel.
- Usage:
/scripts/autorepair $script
*/5 * * * * /usr/local/cpanel/scripts/dcpumon-wrapper >/dev/null 2>&1
- /usr/local/cpanel/scripts/dcpumon-wrapper:
- Wrapper to start up the service dcpumon. For more information, read our Daily Process Log documentation.
0 */2 * * * /usr/local/cpanel/scripts/shrink_modsec_ip_database -x 2>&1
- /usr/local/cpanel/scripts/shrink_modsec_ip_database:
- This script's purpose is to shrink the ModSecurity database files by removing expired entries.
11 22 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
- /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl:
- Performed regular maintenance tasks for addons such as updates, path validation, etc.
30 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache
- /usr/local/cpanel/scripts/update_db_cache:
- The update_db_cache script specifically edits data in /var/cpanel/datastore.
25 */2 * * * /usr/local/cpanel/bin/mysqluserstore >/dev/null 2>&1
- /usr/local/cpanel/bin/mysqluserstore:
-
This script generates and updates the following files:
-
-
/var/cpanel/databases/users.db
-
/var/cpanel/databases/users.db.cache
-
-
-
15 */2 * * * /usr/local/cpanel/bin/dbindex >/dev/null 2>&1
- /usr/local/cpanel/bin/dbindex:
- Updates and indexes /var/cpanel/databases/dbindex.db.json.
09,39 * * * * /usr/local/cpanel/scripts/clean_user_php_sessions > /dev/null 2>&1
- /usr/local/cpanel/scripts/clean_user_php_sessions:
- This script purges expired PHP session files from a secure temporary directory. For more information, read our The clean_user_php_sessions Script documentation.
1,16,31,46 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
- /usr/local/cpanel/whostmgr/bin/dnsqueue:
- It checks on the status of DNS zone changes that are queued for the DNS cluster.
@reboot /usr/local/cpanel/bin/onboot_handler
- /usr/local/cpanel/bin/onboot_handler:
-
This script runs any scripts that exist in the /var/cpanel/on_boot and /usr/local/cpanel/libexec/on_boot directories automatically when it reboots. For more information, read our The onboot_handler Script documentation.
-
29 23 * * * /usr/local/cpanel/3rdparty/bin/freshclam --quiet --no-warnings
- /usr/local/cpanel/3rdparty/bin/freshclam --quiet --no-warnings:
- This script updates the Clam AntiVirus Database. The --quiet option will make so the script only outputs the error messages and the --no-warnings option will log all warnings instead of printing them.
Comments
0 comments
Article is closed for comments.