Crontab problem

I'm looking at the openwrt page about crontab and don't see why this is not working.
The doc mentions nothing about needing quotes or something so I'm not able to figure out why this won't work.

$ crontab -l
0 * * * * /usr/sbin/ntpd -d -n -N -S /usr/sbin/ntpd-hotplug -p 0.pool.ntp.org -p 1.pool.ntp.org -q

$ logread -e cron
Tue Aug 22 19:05:00 2023 cron.err crond[2051]: USER root pid 1463 cmd /usr/sbin/ntpd -d -n -N -S /usr/sbin/ntpd-hotplug -p 0.pool.ntp.org -p 1.pool.ntp.org -q
Tue Aug 22 19:10:00 2023 cron.err crond[2051]: USER root pid 2124 cmd /usr/sbin/ntpd -d -n -N -S /usr/sbin/ntpd-hotplug -p 0.pool.ntp.org -p 1.pool.ntp.org -q
Tue Aug 22 19:10:10 2023 cron.err crond[2051]: user root: parse error at @hourly
Tue Aug 22 19:10:10 2023 cron.err crond[2051]: user root: parse error at /usr/sbin/ntpd
Tue Aug 22 19:10:10 2023 cron.err crond[2051]: user root: parse error at -d
Tue Aug 22 19:10:10 2023 cron.err crond[2051]: user root: parse error at -n
Tue Aug 22 19:10:10 2023 cron.err crond[2051]: user root: parse error at -N
Tue Aug 22 19:11:00 2023 cron.err crond[2051]: user root: parse error at @hourly
Tue Aug 22 19:11:00 2023 cron.err crond[2051]: user root: parse error at /usr/sbin/ntpd
Tue Aug 22 19:11:00 2023 cron.err crond[2051]: user root: parse error at -d
Tue Aug 22 19:11:00 2023 cron.err crond[2051]: user root: parse error at -n
Tue Aug 22 19:11:00 2023 cron.err crond[2051]: user root: parse error at -N

I've tried '@hourly', '*/5 * * * *' and now have it set to */1 but the above error still shows hourly so I assume these are old errors.

I also assume that because I'm using options with ntpd, I need to quote this somehow?

Hourly is an extension that is not supported by the busybox cron by default, I think.

The error message suggests that the active crontab still has 'hourly'???

1 Like

Hi, thanks for your input.

As mentioned, I had tested '@hourly' but I'm now using the time method.

This is what I have it set to now, to run every hour.

0 * * * * /usr/sbin/ntpd -d -n -N -S /usr/sbin/ntpd-hotplug -p 0.pool.ntp.org -p 1.pool.ntp.org -q

I think my answer is that when I run;

 logread -e cron

It's just showing previous errors so I think I'm good now.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.