systemd can run specific tasks at specific times or events. You need to create 2 unit files:
- Create a service file:
$ sudo nano /etc/systemd/system/craft-queue.service
And add the service attached to this gist, adapting the ExecStart path to match the one on your server.
- Create a timer file:
$ sudo nano /etc/systemd/system/craft-queue.timer
Add the timer file attached to this gist, adapting the OnCalendar to suit (see documentation).
- Reload systemd:
$ systemctl daemon-reload
- Enable the timer:
$ systemctl enable craft-queue.timer
- Start the timer:
$ systemctl start craft-queue.timer
Gist adapted from blog at https://kenfavors.com/code/nextcloud-crontab-cronjob-settings/.