Closed llaforest closed 1 year ago
@llaforest Thanks for bringing this up.
the sh
is superfluous on V1.x, I checked that.
0 3 * * * /mnt/data/ubios-cert/ubios-cert.sh renew
will do perfectly fine.
Not sure if V3.x really needs the root
- it should do without, does it?
The sh tells cron to execute the program sh and pass in the arguments. Without sh, it will use the default shell. I guess they changed up some shell options and removed sh in 3.x? I just updated my UDM-Pro to 2.x and /bin/sh is a symlink to dash
Same for UDMPro v2.4.23 - had to add root in order to get cron to work correctly. Looking at the native UDM cron jobs, they all the user specified.
https://github.com/alxwolf/ubios-cert/blob/120d0a3b22a513be5e9198cd25379e5db5546732/ubios-cert/ubios-cert.sh#L137
It took a while to understand why the cron were not functionnal on Unifi-OS 3.x on my UDM-SE. It seems that now, the cron are required to specify under which user they will be executed.
Before and not working anymore: 0 3 sh /data/ubios-cert/ubios-cert.sh renew After and working fine on Unifi-OS 3.x: 0 3 root /data/ubios-cert/ubios-cert.sh renew
Not sure why 'sh' should be used so I removed it. I need to test it on my UDM Pro which is on Unifi-OS 1.x.