Overwrite all 1 minute cron jobs?
Hello cPanel Community.
Is there a command that will overwrite all users 1 minute cron jobs to 5 minutes?
There have been many questions on this in the past but no answer provided.
I can see some providers already have removes the 1 minute from the drop list and some providers are overwriting automatically the crons from 1 min to 15.
I hope good knowing man/woman will post a solution.
Thank you!!
-
Hello @tejli You could most likely write something with sed to replace * with */5 How to use sed to find and replace text in files in Linux / Unix shell - nixCraft sed(1) - Linux man page 0 -
The problem you are going to run in to here is each category could and probably does use an asterisk. This SHOULD work, but I only did limited testing, so back up your files first. replace "* * * * *" "*/15 * * * *" -- /var/spool/cron/* Someone may have done something silly so you may also want to run replace "*/1 * * * *" "*/15 * * * *" -- /var/spool/cron/* 0 -
The problem you are going to run in to here is each category could and probably does use an asterisk. This SHOULD work, but I only did limited testing, so back up your files first. replace "* * * * *" "*/15 * * * *" -- /var/spool/cron/* Someone may have done something silly so you may also want to run replace "*/1 * * * *" "*/15 * * * *" -- /var/spool/cron/*
Thank you!!! As I know this one will replace even hourly or daily crons to 15 min right? replace "* * * * *" "*/15 * * * *" -- /var/spool/cron/* 2: This one will replace cpanel users crons or servers crons only?0 -
It will not change anything other than the minutely crons. It will change the user crons which includes the user root. But not the system crons in /etc/cron* 0
Please sign in to leave a comment.
Comments
4 comments