Start job at boot

Hi all,
I would like my script to start at boot only once. Obviously the script works regularly if started manually
I scheduled it like this:

@reboot /root/script.sh

but it does not start at boot. Yet openwrt should support the @reboot tag:

https://openwrt.org/docs/guide-user/base-system/cron

How can I solve it?

Thanks

@reboot does not work, it's not implemented.

You can add your job to /etc/rc.local

Ok thanks for the answer I imagined.
I didn't trust putting the start in rc.local because it's quite delicate and could influence the router start. I preferred to create a script in /etc/init.d and start my script as a service.

Thanks

Yup, this will work as well.

Just keep in mind that every firmware upgrade will delete your service.

But the files in /etc aren't preserved?

Afaik only /etc/config

You need to add files to /etc/sysupgrade.conf if you want to preserve them.

Strange because I had installed and configured postfix and when I upgraded I lost the postfix installation but the configuration under /etc/postfix remained.