Repair cron file
Hello everybody,
I have removed the crontab of the root user by accident. It is difficult for me to restore it from backup (in our ovh hosting environment we have only a snapshot feature, which allows me to restore the entire system, but I cannot access a specific file).
How can I repair crontab so that essential features of WHM/CPanel continue to work as expected, e.g. AutoSSL, auto update etc?
Perhaps can someone please post their crontab?
-
The crontab and it's permissions are as follows: [root@server ~]# stat /var/spool/cron/root File: "/var/spool/cron/root" Size: 1517 Blocks: 8 IO Block: 4096 regular file Device: fd01h/64769d Inode: 394113 Links: 1 Access: (0600/-rw-------) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2020-01-20 05:17:33.840072975 -0600 Modify: 2020-01-07 05:22:54.801632503 -0600 Change: 2020-01-07 05:22:54.801632503 -0600 Birth: -0 -
The crontab and it's permissions are as follows:
[root@server ~]# stat /var/spool/cron/root File: "/var/spool/cron/root" Size: 1517 Blocks: 8 IO Block: 4096 regular file Device: fd01h/64769d Inode: 394113 Links: 1 Access: (0600/-rw-------) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2020-01-20 05:17:33.840072975 -0600 Modify: 2020-01-07 05:22:54.801632503 -0600 Change: 2020-01-07 05:22:54.801632503 -0600 Birth: -
Ok, thank you. Clearly, I don't have this file. However, I still need the content to recreate it. Perhaps, I need to run some whm/cpanel script which does that? Would upgrading to a newer version of whm recreate the file? Unfortunately, I already have the newest version running...0 -
Ok, thank you. Clearly, I don't have this file. However, I still need the content to recreate it. Perhaps, I need to run some whm/cpanel script which does that? Would upgrading to a newer version of whm recreate the file? Unfortunately, I already have the newest version running...
You can run:/scripts/upcp --force
I don't know if it restores your crontab but no harm done if you run it.0 -
You can run:
/scripts/upcp --force
I don't know if it restores your crontab but no harm done if you run it.
Yes, it worked! Thank you!0 -
Hello, I'm aware you don't have it, which is why I provided you the stat of the file which includes everything you'd need to recreate it. This provides you with the path, permissions, and ownership in order to recreate it. If you're not sure how to create the file it's just: touch /var/spool/cron/root
A cPanel update should auto-populate it once more but default root cron jobs are as follows:[root@server config]# crontab -l 0 6 * * * /usr/local/cpanel/scripts/exim_tidydb > /dev/null 2>&1 30 5 * * * /usr/local/cpanel/scripts/optimize_eximstats > /dev/null 2>&1 @reboot /usr/local/cpanel/bin/onboot_handler 8 0 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify 17 5 * * * (/usr/local/cpanel/scripts/fix-cpanel-perl; /usr/local/cpanel/scripts/upcp --cron > /dev/null) 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 0 */2 * * * /usr/local/cpanel/scripts/shrink_modsec_ip_database -x 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 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 15 */6 * * * /usr/local/cpanel/scripts/autorepair recoverymgmt >/dev/null 2>&1 */5 * * * * /usr/local/cpanel/scripts/dcpumon-wrapper >/dev/null 2>&1 14,29,44,59 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1 4 0 * * * /usr/local/cpanel/3rdparty/bin/freshclam --quiet --no-warnings 22 22 * * 7 /usr/local/cpanel/scripts/send_api_notifications > /dev/null 2>&1 09,39 * * * * /usr/local/cpanel/scripts/clean_user_php_sessions > /dev/null 2>&10
Please sign in to leave a comment.
Comments
6 comments