Crontab Info
January 4, 2018
Examples:
https://crontab.guru/examples.htmlInfo:
https://crontab.guru/crontab.5.htmlfor Nextcloud:
https://docs.nextcloud.com/server/11/admin_manual/configuration_server/background_jobs_configuration.htmlNextcloud better example:
https://help.nextcloud.com/t/error-on-cron-php-execute-via-crontab-or-command-line/583/2
$ sudo -u www-data crontab -e
then enter the code below at the bottom (runs every 4 hours):
* */4 * * * php -f /var/www/html/nextcloud/cron.php
0r everyday at 2am:
* 2 * * * php -f /var/www/html/nextcloud/cron.php
To verify if the cron job has been added and scheduled:
$ sudo -u www-data crontab -l
More info & editing crontabs:
https://help.ubuntu.com/community/CronHowtoto edit the crontab:
sudo -u www-data crontab -e
How can I tell if my crontab has run:
check ‘/var/log/syslog’or better yet:
http://askubuntu.com/questions/149504/how-can-i-tell-if-my-hourly-cron-job-has-runto check cron status:
$ systemctl status cron
also, how to run a cron manually (the example below is for nextcloud):
$ sudo -u www-data php -f /var/www/html/nextcloud/cron.php
Posted in Tutorials