Error logging in to crontab

I am trying to make a cron entry for a shell script:

50 */4 * * * /path/script-file.sh > /dev/null 2>&1

aims to run a script on HH: 50 with a frequency of 4 hours. But this is a mistake with the message:

crontab: error in the previous line; unexpected character found in string.

crontab: input errors detected, crontab file not created.

I deleted "/ 4" and the error went away, but I know cron allows this format. Does anyone know what the problem is?

Thanks so much for any help.

+3
source share
1 answer

Some implementations crondo not support steps (for example */4) - check man 5 crontabon your specific system.

You can use a list instead 0,4,8,12,16,20.

Off-topic: bash, , , > /dev/null 2>&1 &>/dev/null stdout stderr 1>&- 2>&-. (. @Keith )

+3

All Articles