accidentally-resetted-cron jobs-cpanel

How to resolve accidentally resetted or deleted cron jobs in cpanel or linux servers

I know, it is hard to keep/put your fingers correctly on the keyboards letters.

Many type “i” instead of “o”, “r” instead of “e”, After all we are humans and make mistakes 🙂

In cpanel installed servers, there are many crons running to do the automated process,
Like upgrading the cpanel, bandwidth usage, account backups & etc..

beyond this crons/scheduled jobs, some time we want to add more or edit the time when the jobs need to run.

For this you use any text editor like, vi or nano or pico

eg.

root@earneasy # nano /var/spool/cron/root

another easier way to do it is by typeing.

root@earneasy # crontab -e

What, if you have typed crontab -r

root@earneasy # crontab -r

it removes, resets all the cron jobs stored in /var/spool/cron/root file.

All the automated jobs will stop working.

How to resolve accidentally resetted or deleted cron jobs in cpanel or linux servers

No worries, this can resolved easily.

if you have other cpanel installed servers,
just cat /var/spool/cron/root and get all the contents and save it to the problem server and save it.

or, just copy the below cron jobs

root@earneasy # crontab -e
Typing crontab -e or nano /var/spool/cron/root
0 6 * * * /usr/local/cpanel/scripts/exim_tidydb > /dev/null 2>&1
30 5 * * * /usr/local/cpanel/scripts/optimize_eximstats > /dev/null 2>&1
2,58 * * * * /usr/local/bandmin/bandmin
0 0 * * * /usr/local/bandmin/ipaddrmap
19 2 * * * /usr/local/cpanel/scripts/upcp --cron
0 1 * * * /usr/local/cpanel/scripts/cpbackup
0 2 * * * /usr/local/cpanel/bin/backup
35 * * * * /usr/bin/test -x /usr/local/cpanel/bin/tail-check && /usr/local/cpanel/bin/tail-check
45 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_mailman_cache && /usr/local/cpanel/scripts/update_mailman_cache
30 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache
45 */8 * * * /usr/bin/test -x /usr/local/cpanel/bin/optimizefs && /usr/local/cpanel/bin/optimizefs
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
8 0 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
2,17,32,47 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1

 

Thats all, leave your feed back.

if it helped you, share this with your friends and colleges
For Other cpanel related post click here

Comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.