-
-
Notifications
You must be signed in to change notification settings - Fork 238
Managing cron
sudo snap get nextcloud nextcloud.cron-interval
Nextcloud recommends a 5 Minute interval:

value =5m in minutes
sudo snap set nextcloud nextcloud.cron-interval=5m
sudo snap restart nextcloud.nextcloud-cron
sudo nextcloud.occ background:cron
sudo snap set nextcloud nextcloud.cron-interval=-1
value =5m in minutes
sudo snap set nextcloud nextcloud.cron-interval=5m
By default the cronjob interval up until Nextcloud 29.0.x was 15 minutes. Nextcloud from 30.0.x recommends a 5 Minute interval:

To adjust it (to 5 minutes) simply run:
$ sudo snap set nextcloud nextcloud.cron-interval=5m
If you want to disable the cronjob completely, run:
$ sudo snap set nextcloud nextcloud.cron-interval=-1
To reenable it again simply set the nextcloud.cron-interval snap variable to a value that isn't -1
sudo crontab -lsudo crontab -e* * * * * nextcloud.occ <function>:<command> <--option>Examples:
scan files
* * * * * nextcloud.occ files:scan --allpreview generator
* * * * * nextcloud.occ preview:generate-all -vvvclean trash
* * * * * nextcloud.occ trashbin:cleanup --all-users
best practice to run user scripts requiring root privileges as cronjob
* * * * * su <USER> /home/<USER>/path/to/script.shsee https://crontab.guru/
Nextcloud snap Wiki, use all information and scripts at own risk
- HTTP/HTTPS port configuration
- PHP configuration options
- Hosts & FQDN configuration
- Reverse proxy configuration
- CODE & Nextcloud Office configuration
- HPB client-push configuration
- Managing Nextcloud snap
- Managing automatic updates
- Managing automatic update issues
- Managing external media and storage
- Managing logs
- Managing services
- Managing cron
- Managing HTTP encryption
- OCC management console