[Solved] Cron.err crond: user root: parse error

Hello,

checking the logfiles I can see many eror entries for cron:

root@eddie:~# logread -e cron
Sun Jun 19 22:45:41 2022 cron.err crond[7859]: crond (busybox 1.33.2) started, log level 5
Sun Jun 19 22:45:41 2022 cron.err crond[7859]: user root: parse error at @daily
Sun Jun 19 22:45:41 2022 cron.err crond[7859]: user root: parse error at /usr/sbin/opkg-upgrade
Sun Jun 19 22:45:41 2022 cron.err crond[7859]: user root: parse error at -u
Sun Jun 19 22:45:41 2022 cron.err crond[7859]: user root: parse error at &&
Sun Jun 19 22:45:41 2022 cron.err crond[7859]: user root: parse error at touch
Sun Jun 19 22:46:00 2022 cron.err crond[7859]: user root: parse error at @daily
Sun Jun 19 22:46:00 2022 cron.err crond[7859]: user root: parse error at /usr/sbin/opkg-upgrade
Sun Jun 19 22:46:00 2022 cron.err crond[7859]: user root: parse error at -u
Sun Jun 19 22:46:00 2022 cron.err crond[7859]: user root: parse error at &&
Sun Jun 19 22:46:00 2022 cron.err crond[7859]: user root: parse error at touch
Sun Jun 19 22:57:11 2022 cron.err crond[7942]: crond (busybox 1.33.2) started, log level 5
Sun Jun 19 22:57:11 2022 cron.err crond[7942]: user root: parse error at @daily
Sun Jun 19 22:57:11 2022 cron.err crond[7942]: user root: parse error at '/usr/sbin/opkg-upgrade
Sun Jun 19 22:57:11 2022 cron.err crond[7942]: user root: parse error at -u
Sun Jun 19 22:57:11 2022 cron.err crond[7942]: user root: parse error at &&
Sun Jun 19 22:57:11 2022 cron.err crond[7942]: user root: parse error at touch

This is my current crontab:

root@eddie:~# crontab -l
@daily '/usr/sbin/opkg-upgrade -u && touch /tmp/opkg-upgrade-check || rm -f /tmp/opkg-upgrade-check' 2>&1
0 4 * * 0 /usr/local/bin/backup-stats.sh

Can you please advise what is causing this error?

THX

@ tags aren’t supported
Pick a time of day and set up the time in a more traditional format

1 Like

Based on OpenWrt documentation shortcut is supported.

I solved the issue by putting the commands in a script (in /usr/local/bin) and calling this script in cron.

I'm glad it is working for you.
In my experience, shortcuts are not supported. As you can see here, they are disabled by default:
git.openwrt.org Git - openwrt/openwrt.git/blob - package/utils/busybox/Config-defaults.in
and
git.openwrt.org Git - openwrt/openwrt.git/blob - package/utils/busybox/config/miscutils/Config.in

Maybe they are turned on elsewhere, but that is my current understanding.