Score:0

Bad Day of the Month error in simple crontab

br flag

I have a script that should run every 4 hours. */240 **** ./autorun.sh

It's my first attempt at creating a crontab and it seemed easy enough, obviously somethings wrong but I don't see why and the error message doesn't make sense to me. Any help is appreciated.

This is the output after saving my first crontab:

crontab: installing new crontab "/tmp/crontab.YYOJBl/crontab":23: bad day-of-month errors in crontab file, can't install.

24601 avatar
in flag
does [this Q&A from stackoverflow](https://stackoverflow.com/questions/56855429/crontab-error-tmp-crontab-caljpk5-bad-day-of-month#56855698) answer your question?
cn flag
*/240 **** ./autorun.sh please format this. I do not see spaces between the****.
Score:1
cn flag

Please use crontab guru for creating and testing cron tab times.

Every 4 hours means using the HOURS column and dividing by 4 with the MINUTES set to a fixed amount. So that would be 0 */4 * * *.

*/240 * * * * would mean every 240th minute of an hour. That seems invalid to me as minutes end at 60 so 0-59 are valid numbers.

br flag
Thanks, I'm fairly new to Linux and before winging something I try googling first. In this instance I used information I found on the following website for guidance: https://tecadmin.net/crontab-in-linux-with-20-examples-of-cron-schedule/ This is the example I followed: */10 * * * * /scripts/monitor.sh */10: means to run every 10 minutes. Same as if you want to execute on every 5 minutes use */5.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.