jobd.pl: one update-only gc-only needs-gc-only bonanza
commitfcfa7f3b842802602ed884997fc3135267ec700d
authorKyle J. McKay <mackyle@gmail.com>
Sat, 30 Dec 2017 13:51:31 +0000 (30 05:51 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Sat, 30 Dec 2017 13:51:31 +0000 (30 05:51 -0800)
tree7848923082d2666e33cb83ab9b4428a4844c1b56
parent96c45a8d411e07c4972a96613d0e49639b07478a
jobd.pl: one update-only gc-only needs-gc-only bonanza

Allow the `--one PRJNAME` option to be repeated so that more than
one individually specified project may be processed during a single
run of jobd.pl.

This could be simulated simply by running jobd.pl multiple times,
but it's much more efficient just to allow the option to be repeated
instead.

Introduce new `--update-only`, `--gc-only` and `--needs-gc-only`
options that work with either the `--all-once` or `--one PRJNAME`
option.

Processing will be limited to the specified mode.  In other words,
`--all-once --update-only` will run through all the projects once
but only perform any needed mirror updates while skipping any needed
gc operations.

Similarly `--all-once --gc-only` will run through all the projects
once but only perform any needed garbage collection operations while
skipping any needed mirror updates.

The `--all-once --needs-gc-only` combination works similarly to the
`--all-once --gc-only` combination except that the only garbage
collection operations that get run are for those projects with a
`.needsgc` file present in them.  All other garbage collection and
mirror update operations are skipped.

With these new options it's possible to fine tune when jobd.pl
will perform various functions.

For example, `--all-once --needs-gc-only` could be run several
times per day while `--all-once --update-only` gets run just once
in the middle of the night and `--all-once --gc-only` gets run
just once a week at an off time.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
jobd/jobd.pl