How can I set up my crontab to execute X script at 11:59PM every day without emailing me or creating any logs?
Right now my crontab looks something like this
@daily /path/to/script.sh
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 .
If your system uses log rotate, then older logs will have a timestamp appended; for example “cron-20170522”. To verify, just open the cron log file and search for “ ntpdate ”, and you should see that the command is run by the root user. Hopefully, this helps someone that needs to run a scheduled command or script.
When you do crontab -e, try this:
59 23 * * * /usr/sbin/myscript > /dev/null
That means: At 59 Minutes and 23 Hours on every day (*) on every month on every weekday, execute myscript.
See man crontab for some more info and examples.
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