Hello, my cron job is not working:
in http://192.168.1.1/cgi-bin/luci/admin/status/logs (syslog):
Tue Aug 15 15:23:00 2023 cron.err crond[1510]: USER root pid 4568 cmd /usr/bin/wireguard_watchdog
Tue Aug 15 15:24:00 2023 cron.err crond[1510]: USER root pid 4587 cmd /usr/bin/wireguard_watchdog
Tue Aug 15 15:25:00 2023 cron.err crond[1510]: USER root pid 4605 cmd /usr/bin/wireguard_watchdog
Tue Aug 15 15:26:00 2023 cron.err crond[1510]: USER root pid 4623 cmd /usr/bin/wireguard_watchdog
Tue Aug 15 15:27:00 2023 cron.err crond[1510]: USER root pid 4641 cmd /usr/bin/wireguard_watchdog
running multiple times
root@wdr3500:~# /usr/bin/wireguard_watchdog
does not create any entrys in syslog
root@wdr3500:~# cat /etc/crontabs/root
* * * * * /usr/bin/wireguard_watchdog
I have searched in this forum but still not be able to understand what the problem is. Expected behavior: cron gives not such errors in syslog. There are much threads about such an error. I could not figure out, what this means and how to solve. So I ask u directly.
root@wdr3500:~# ls -la /usr/bin/*
snip
lrwxrwxrwx 1 root root 17 Apr 27 22:28 /usr/bin/wc -> ../../bin/busybox
-rwxr-xr-x 1 root root 42037 Feb 8 2022 /usr/bin/wg
lrwxrwxrwx 1 root root 18 Apr 27 22:28 /usr/bin/wget -> /bin/uclient-fetch
lrwxrwxrwx 1 root root 17 Apr 27 22:28 /usr/bin/which -> ../../bin/busybox
-rwxr-xr-x 1 root root 2780 Feb 8 2022 /usr/bin/wireguard_watchdog
lrwxrwxrwx 1 root root 17 Apr 27 22:28 /usr/bin/xargs -> ../../bin/busybox
snip
root@wdr3500:~# crontab -l
* * * * * /usr/bin/wireguard_watchdog
I have added a own logger command into the wireguard_watchdog file:
root@wdr3500:~# cat /usr/bin/wireguard_watchdog | grep logger
logger -t "wireguard_monitor" "${iface} endpoint ${endpoint_host}:${endpoint_port} is not responding for ${idle_seconds} seconds, trying to re-resolve hostname"
logger -t "wireguard_monitor" Monitor checked for wg-health. Ok...
Now get this every minute:
Tue Aug 15 15:48:00 2023 cron.err crond[5174]: USER root pid 5334 cmd /usr/bin/wireguard_watchdog
Tue Aug 15 15:48:00 2023 **user.notice wireguard_monitor: Monitor checked for wg-health. Ok...**
Tue Aug 15 15:49:00 2023 cron.err crond[5174]: USER root pid 5355 cmd /usr/bin/wireguard_watchdog
Tue Aug 15 15:49:00 2023 **user.notice wireguard_monitor: Monitor checked for wg-health. Ok...**
root@wdr3500:~# ps w | grep cron
5174 root 1312 S /usr/sbin/crond -f -c /etc/crontabs -l 5
5474 root 1308 S grep cron
For reference the user guide is here: https://openwrt.org/docs/guide-user/base-system/cron
What does cron.err crond[5174] or cron.err crond[1510] mean and how to fix it? Also the wireguard_watchdog does not seem to work in my case, because I use only IPs in wireguard config, so there is no hostname to resolve (IPs are skiped), source code:
Can we solve also the IPs skipped problem or should I open a new thread for for every detail? Thank you very much.