How to use crontab/scheduler?

I tried crontab -e, but got an error: crontab: can't change directory to '/var/spool/cron/crontabs': No such file or directory

Is crontab unsupported? If so, is there another method to schedule renewal of the tailscale SSL certificate?

What model and version of the device you are using?

All OpenWRT-based devices should be supported. Use crontab -e/ or Luci's schedule task

Comet GL-RM1, FW v1.3.0 release1 - as mentioned above, I tried crontab -e but got an error message

GLKVM are not base on OPENWRT

The crontab command is not supported, and there are currently no alternative methods to set up scheduled tasks.

mkdir -p /var/spool/cron/crontabs
Just need to create a directory

I tried creating this folder, but after creating a simple cron task to create a folder in /tmp, it did not work. Also, after rebooting the kvm, this folder gets deleted every time. Do you have any other suggestions to get cron working properly?

1 Like

Maybe try soft linking

mkdir -p /etc/crontabs  /var/spool/cron/
ln -s /etc/crontabs  /var/spool/cron/crontabs
crontab  -e

You can set it to start at boot

cat >> /etc/init.d/S49alsa << EOF
               mkdir -p /etc/crontabs  /var/spool/cron/
               ln -s /etc/crontabs  /var/spool/cron/crontabs
               crond
EOF
sync

EDITED: the symlink instructions you provided work much better. this persists the file after each time i use crontab -e, and i managed to successfully create a cron task to create a folder. i will do some more testing to confirm it still works after rebooting. thanks for the assistance!

unrelated but FYI since you work with this team - the S99kvmd-nginx script makes a call on line 11 to /etc/init.d/S50nginx, a script that does not exist. since this script does not exist, the method i'm using to restart nginx after updating the ssl certificates is:

killall nginx
/etc/init.d/S99kvmd-nginx start

if there is a better way to do this, please let me know.

There are indeed some problems. I need to ask R&D. Please wait for some time.

As for the S99_crond script, how do i get the system to run this script on boot? I can see the file and it is +x executable, but it did not run after rebooting.

I'm having the same problem and looking for help from the development team.
Currently you can manually run /etc/init.d/S99_crond start

unfortunately this kind of defeats the purpose if it does not persist after reboots...i will keep checking this thread for updates.

Yes, please wait for some time and the developer will follow up during the working day.

@dapharsyde You can add commands to the existing startup script to load crond