Cron

Cron jobs are used for the time-controlled execution of shell commands or scripts. You can read more about them in the debian manpage. For better traceability and accountability all output are logged to syslog. To achieve this, we use a small shell wrapper that is defined with the following line in the cron job file.

Cronjob Shell Wrapper
SHELL=/usr/local/vzscripts/sfoutputtosyslog

Hint

Due to our configuration the MAILTO and other variables cannot be used to recieve notifications by email. If you would like to receive an email for each run, you can set it up like this:

Mail cronjob
*/15  *       *       *       *       <some-command-with-output> |& tee >(mail -s "Cron <${USER}@$(hostname)>" <user@domain.tld>)

Hint

You can search for cronjob logs of a specific website as follows:

Check Cronjob Logs
grep 'CRON.*<website name>' /var/log/syslog

Custom Cronjobs

To configure your own jobs, connect to the server via SSH (e.g. ssh website-user@servername) and run the following command:

SSH Session
crontab -e

We provide a template including all required configuration and examples, which is loaded by default.