Show activity on this post. ->cron('0 */12 * * *'); This cron will run the scheduler at every 12 hours.
You forgot a *
, and you've too many fields. It's the hour you need to care about
0 */6 * * * /path/to/mycommand
This means every sixth hour starting from 0, i.e. at hour 0, 6, 12 and 18 which you could write as
0 0,6,12,18 * * * /path/to/mycommand
You should include a path to your command, since cron runs with an extensively cut-down environment. You won't have all the environment variables you have in your interactive shell session.
It's a good idea to specify an absolute path to your script/binary, or define PATH in the crontab itself. To help debug any issues I would also redirect stdout/err to a log file.
0 */6 * * * command
This will be the perfect way to say 6 hours a day.
Your command puts in for six minutes!
Please keep attention at this syntax:
* */6 * * *
This means 60 times (every minute) every 6 hours,
not
one time every 6 hours.
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