I have a base config with most of my useful settings in, but not cron jobs.
Is it sufficient to add /etc/crontabs/root to the base config tarball?
Additionally, it looks like cron is not enabled by default.
So I could add /etc/rc.d/S50cron to the base config but I suspect that this is the wrong way of doing it [not least because it's a symlink].
Alternatively, I could run "/etc/init.d/cron enable" on first boot after restore. But I am not sure if there is "a thing" that does this?
Failing that I can just put it in /etc/rc.local .
/etc/crontabs/root
is preserved by default.
You can get a list in LuCI -> Backup / Flash Firmware -> Configuration.
I believe crontab -e
+ saving and editing the crontabs through LuCI both enable the service, but yes, you can add service cron enable
to a script that gets executed on first boot.
Simplest is probably building the image at https://firmware-selector.openwrt.org/