How to delete cron entry from Linux server using chef recipie I tried using cron resource with action . It is not deleting.
Asked
Active
Viewed 20 times
-1
-
Hi! Please post more details about cron job you have using `crontab -l` or something like that. And please also edit question and add the code you used to remove the cron job. Please refer [minimal-reproducible-example](https://stackoverflow.com/help/minimal-reproducible-example). – seshadri_c Aug 23 '23 at 09:29
-
0 21 * * * /bin/bash -c "sleep $[RANDOM \% 60 + 1]m"; nice -n 10 /opt/snow/snowagent -w /opt/snow/ >/dev/null 2>&1 I want to delete the above entry – Hema Aug 29 '23 at 18:30
-
cron 'snow_agent_remove' do minute '0' hour '21' day '*' month '*' weekday '*' action :delete command '0 21 * * * /bin/bash -c "sleep $[RANDOM \% 60 + 1]m"; nice -n 10 /opt/snow/snowagent -w /opt/snow/ >/dev/null 2>&1' only_if 'crontab -l | grep /opt/snow/snowagent | grep -i random | grep 4' end – Hema Aug 29 '23 at 18:35
-
Hi, please edit the question and add this information there. It's really hard to understand the code posted in comments. – seshadri_c Aug 30 '23 at 09:22