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):
# crontab -l
@reboot /usr/sbin/cloudlinux-collect-panic-info
47 3 * * * (/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
5,20,35,50 * * * * /usr/local/cpanel/scripts/eximstats_spam_check 2>&1
#6 22 * * * /usr/local/cpanel/scripts/autorepair recoverymgmt >/dev/null 2>&1
*/5 * * * * /usr/local/cpanel/scripts/dcpumon-wrapper >/dev/null 2>&1
21 * * * * /usr/local/cpanel/scripts/upcp --security
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
3,18,33,48 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
0 */2 * * * /usr/local/cpanel/scripts/shrink_modsec_ip_database -x 2>&1
09,39 * * * * /usr/local/cpanel/scripts/clean_user_php_sessions > /dev/null 2>&1
4 * * * * /usr/local/cpanel/bin/process_team_queue > /dev/null 2>&1
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.
CONFIG_TEXT: 47 3 * * * (/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).
CONFIG_TEXT: 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.
CONFIG_TEXT: 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.
CONFIG_TEXT: 0 6 * * * /usr/local/cpanel/scripts/exim_tidydb > /dev/null 2>&1
-
/usr/local/cpanel/scripts/exim_tidydb:
- Cleans the exim message log.
CONFIG_TEXT: 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.
CONFIG_TEXT: 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
CONFIG_TEXT: 6 22 * * * /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
CONFIG_TEXT: */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.
CONFIG_TEXT: 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.
CONFIG_TEXT: 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.
CONFIG_TEXT: 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
- This script generates and updates the following files:
CONFIG_TEXT: 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.
CONFIG_TEXT: 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.
CONFIG_TEXT: 3,18,33,48 * * * * /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.
CONFIG_TEXT: @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.
Comments
0 comments
Article is closed for comments.