I'm using the "whenever" gem and got it working by doing:
whenever --set environment=production --update-crontab theCronJob
The interval I'm using is 2 minutes since I'm still trying to figure it out. However, now I get a You have mail message in my terminal window every 2 minutes. I guess the cron runs and lets me know about it. How do I stop my cron from running? These messages are starting to pile up.
Thank you
Stop a cron job You can stop a single cron job by removing its line from the crontab file. To do that, run the crontab -e command and then delete the line for the specific task.
The cron reads the crontab (cron tables) for running predefined scripts. By using a specific syntax, you can configure a cron job to schedule scripts or other commands to run automatically.
By default, crontab file protections are set up so that you cannot inadvertently delete a crontab file by using the rm command. Instead, use the crontab -r command to remove crontab files. By default, the crontab -r command removes your own crontab file.
It is a wildcard for every part of the cron schedule expression. So * * * * * means every minute of every hour of every day of every month and every day of the week .
To delete the auto-generated cronjobs from your crontab, run whenever
against your defintion file with the -c
flag:
$ whenever -c theCronJob
Alternatively, open your crontab...
$ crontab -e
... and then manually delete the undesired entries.
following will delete the scheduled crontab:
crontab -r
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With