Background jobs - listing and identifying

Hi

I realise there is another post about this - but no-one has answered it in 7 years, so perhaps I’ll ask it again.

  1. Is there a list of all the various background jobs?
  2. Is there a good way to instrospect them? Whilst I can query the db, many dont have the knowledge to do this
  3. How many jobs should there be in this list? Should it fall to 0 at some point? How does one identify recurring jobs (or are all entries in the database table single-shots?)

My machine seems to have 61 jobs in the db at ALL times. I want to know what they are up to. TBH, I want to know how long each one is running, what caused them to run, and how much resource they consumed.

These seem like basic things an admin user should want to know, but there is almost no user interface for monitoring NC instances. The best there is seems to be a not-well-implemented “system monitor” page, which shows CPU load, CPU temp, and disk usage, but not much more.

Thoughts?

  • Is there a list of all the various background jobs?

Every app, including third-party apps you may have installed may create jobs. So not really.

  • Is there a good way to instrospect them? Whilst I can query the db, many dont have the knowledge to do this

occ background-job:list

  • How many jobs should there be in this list? Should it fall to 0 at some point? How does one identify recurring jobs (or are all entries in the database table single-shots?)

It’ll vary constantly and from environment to environment. There are one-time (queued) jobs and recurring (timed) jobs. A million different things can cause them to be created or run.

Additional information is currently also exposed via occ background-job:execute <job#> - e.g.

www-data@83e3407f887c:~/html$ ./occ background-job:execute 5
Job class:            OCA\Files_Sharing\DeleteOrphanedSharesJob
Arguments:            null
Type:                 timed

Last checked:         2024-11-19T23:05:00+00:00
Reserved at:          -
Last executed:        2024-11-18T23:10:00+00:00
Last duration:        0
Next execution:       2024-11-19T23:10:00+00:00

Job was not executed because it is not due
Specify the --force-execute option to run it anyway
www-data@83e3407f887c:~/html$ 

I want to know how long each one is running, what caused them to run, and how much resource they consumed.

Adjusting your logging to be more verbose will expose more infor. Every time a job is started or finishes (among other situations) it’s logged at the debug loglevel (0).

1 Like

Thanks - that’s useful info :slight_smile:

Any idea why the background jobs list doesn’t indicate next execution time? Seems like it’d be a useful thing to know…

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.