Is there a list of background/cron jobs with execution schedule available somewhere?
I tried to find out by searching the code, found getJobList(), registerJob() but did not find where the jobs are actually added to the list.
mysql -u<user> -p<pass> -e 'select * from nextcloud.oc_jobs;' somehow lists the jobs, but it is not well readable and hard to figure out which one is executed how often at what times.
I sometimes face topics here where this information could be useful to check if some error message could be related to a cron job execution (and which job exactly) or not.
PHP Fatal error: Interface 'OCP\BackgroundJob\IJobList' not found in /var/www/nextcloud/lib/private/BackgroundJob/JobList.php on line 37
I guess that external scripts can not include nextcloud scripts something like this including access to database etc. mysql -u<user> -p<pass> -e 'select * from nextcloud.oc_jobs';
This somehow shows the jobs for me, but it is a bid a mess to extract schedules from it and what which job actually does. I was hoping from an official list from nextcloud developers which contains all background jobs from the nextcloud core/core apps.
Just translated the unix time stamps from above. All active jobs are checked every 15 minutes with cron.php. FirstRunWizard of course does not run for my user(s), anyway the app is also inactive. Federation and OwnBackup are inactive/removed.
For all the other jobs, you could derive the execution schedule moreless from the last_run time stamp:
OCA\NextcloudAnnouncements\Cron\Crawler
last_run 10.10.2017 - 16:30:08
=> still no execution at 01:00
OCA\Files_Versions\BackgroundJob\ExpireVersions
last_run 10.10.2017 - 21:30:02
=> every 30 minutes?
OCA\Activity\BackgroundJob\EmailNotification
last_run 10.10.2017 - 21:45:03
=> 00:45:02 clearly after 01:00 , and same as `ExpireVersions` then, thus every 30 minutes?
OCA\Activity\BackgroundJob\ExpireActivities
last_run 10.10.2017 - 17:30:10
=> still no execution until 01:00
OCA\Files\BackgroundJob\ScanFiles
last_run 10.10.2017 - 21:45:03
=> every 15 minutes
OCA\Files\BackgroundJob\DeleteOrphanedItems
last_run 10.10.2017 - 21:45:03
=> 00:00:03 at 01:00 , thus every hour?
OCA\Files\BackgroundJob\CleanupFileLocks
last_run 10.10.2017 - 21:45:03
=> every 15 minutes
OCA\Files_Sharing\DeleteOrphanedSharesJob
last_run 10.10.2017 - 21:45:03
=> 00:45:02 clearly after 01:00 , thus every 30 minutes?
OCA\Files_Sharing\ExpireSharesJob
last_run 10.10.2017 - 14:00:10
=> still no execution until 01:00
OCA\DAV\CardDAV\SyncJob
last_run 10.10.2017 - 14:00:10
=> same as ExpireSharesJob
OCA\UpdateNotification\Notification\BackgroundJob
last_run 10.10.2017 - 17:30:10
=> same as ExpireActivities
OCA\Files_Trashbin\BackgroundJob\ExpireTrash
last_run 10.10.2017 - 21:45:03
=> 00:30:03 at 01:00 , every hour?
\OC\Authentication\Token\DefaultTokenCleanupJob
last_run 10.10.2017 - 21:45:03
=> every 15 minutes
OCA\UpdateNotification\ResetTokenBackgroundJob
last_run 10.10.2017 - 21:45:03
=> every 15 minutes
It is a mess to derive the times from there, especially because the jobs seem to be re added after their execution with wanted delay, thus because of exact 15 minutes cron.php will be added to one cron execution later. This causes jobs that want to be executed every 30 minutes to be executed actually every 45 minutes .
As you can see from oc_jobs that background jobs are added by the apps, I found this easier: https://github.com/nextcloud/server/blob/master/apps/files_versions/lib/BackgroundJob/ExpireVersions.php#L48
=> files_versions checks for expired file versions every 30 minutes
=> NextcloudAnnouncements\Cron\Crawler, ExpireActivities, ExpireSharesJob, Federation- and CardDAV SyncJobs would be e.g. candidates that run once a day, which can be easily found out by checking their background job php .
But it thus really depends on the active/installed apps, so everybody should check his own job list via mysql command above.
I know this thread is a bit older but I just found it and wanted to share a tip: using mysql you can easily convert the timestamps to readable dates:
select class, argument, FROM_UNIXTIME(last_run) as last_run, FROM_UNIXTIME(last_checked) as last_checked, FROM_UNIXTIME(reserved_at) as reserved_at from oc_jobs order by last_run;