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>&130 5 * * * /usr/local/cpanel/scripts/optimize_eximstats > /dev/null 2>&12,58 * * * * /usr/local/bandmin/bandmin0 0 * * * /usr/local/bandmin/ipaddrmap19 2 * * * /usr/local/cpanel/scripts/upcp --cron0 1 * * * /usr/local/cpanel/scripts/cpbackup0 2 * * * /usr/local/cpanel/bin/backup35 * * * * /usr/bin/test -x /usr/local/cpanel/bin/tail-check && /usr/local/cpanel/bin/tail-check45 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_mailman_cache && /usr/local/cpanel/scripts/update_mailman_cache30 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache45 */8 * * * /usr/bin/test -x /usr/local/cpanel/bin/optimizefs && /usr/local/cpanel/bin/optimizefs30 */2 * * * /usr/local/cpanel/bin/mysqluserstore >/dev/null 2>&115 */2 * * * /usr/local/cpanel/bin/dbindex >/dev/null 2>&115 */6 * * * /usr/local/cpanel/scripts/autorepair recoverymgmt >/dev/null 2>&1*/5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&18 0 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify2,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.