Cron job for beginner, please help


I’m trying to set up a cron job. Specifically for previewgenerator.

How do I do this?

Where are the cron files located?

Thank you.

Usually in /var/spool/cron

Maybe you can use a webcron service called to trigger the script to run, it very easy to set up and supports multiple configurations.

You have to add a cron job like
*/10 * * * * /var/www/html/occ preview:pre-generate
This will generate previews for new files every 10 minutes.

Make sure the right user (www-data) runs that script.
With cron installed, you can simply use crontab -u www-data -e to add the line.

1 Like