Portal Home > Knowledgebase > Articles Database > crontab -r Command means?


crontab -r Command means?




Posted by rcpkrc, 09-19-2013, 04:08 PM
I was going to edit crontab and l made a mistake and typed -r rather than typing -e crontab -r what that means? what l did? now l want to edit crontab via crontab -e and it shows me a blank page...

Posted by Patrick, 09-19-2013, 04:09 PM
crontab -r removes the current cron tab for the user.

Posted by zoid, 09-19-2013, 04:14 PM
r (delete user's crontab)

Posted by rcpkrc, 09-19-2013, 04:36 PM
hmmm l was logged in as root. that means all my default cron tables gone for cpanel ? OMG!! How can l recover them ?

Posted by CodyRo, 09-19-2013, 05:48 PM
Why run a command you don't understand? Always use the manpages! I'm not sure if there is a way to recover it, perhaps running /scripts/upcp (--force?) and see if it adds them. If not simply ticket cPanel asking for the default crons and they'll give them to you .

Posted by zoid, 09-19-2013, 05:58 PM
qwert

Posted by rcpkrc, 09-19-2013, 06:03 PM
well made a mistake no1 help with default cpanel crons?

Posted by Patrick, 09-19-2013, 06:36 PM
Don't worry. Live and learn! Sure. Here are the default root cron's for cPanel: 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 46 21 * * * /usr/local/cpanel/scripts/upcp --cron 0 1 * * * /usr/local/cpanel/scripts/cpbackup 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 12 0 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify 1,16,31,46 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1 0 2 * * * /usr/local/cpanel/bin/backup

Posted by RRWH, 09-19-2013, 07:22 PM
You do have backups? simply restore what you deleted from backup, no big deal.

Posted by Patrick, 09-19-2013, 07:25 PM
This is WHT. AIN'T NOBODY GOT TIME FOR BACKUPS!

Posted by RRWH, 09-19-2013, 07:56 PM
sadly, this is true - because it is much easier to ask someone else to fix your f*up's than plan for when you make them!

Posted by McBane, 09-19-2013, 10:48 PM
If you have no time for backups then you obviously don't care about preserving your data. Essentially, you get what you pay for. Learn it the hard way.

Posted by Mad_matt, 09-19-2013, 11:10 PM
this is one of the reasons why I avoid the commandline as much as possible, its just too easy to get myself into trouble. Considering that "E" and "R" are next to each other, it is surprising that more people dont have this problem. As for backups.... noone would think that trying to add in a new cron job would (by accident) wipe out all the existing crons. If backups are just a day old, you dont want to have to go back unless you really have to.

Posted by BestServerSupport, 09-20-2013, 11:01 AM
If you have the cpanel backup they are in dirs/_var_spool_cron/



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read


Language: