mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
doc: Add a tip to better name mcron jobs.
* doc/guix.texi (Scheduled Job Execution): Specify the 'displayable' argument for the 'updatedb-job' example. Add a tip to better name jobs, referring to the modified example.
This commit is contained in:
parent
aa816708b2
commit
392c7175ae
1 changed files with 10 additions and 1 deletions
|
@ -15919,7 +15919,8 @@ gexps to introduce job definitions that are passed to mcron
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(execl (string-append #$findutils "/bin/updatedb")
|
(execl (string-append #$findutils "/bin/updatedb")
|
||||||
"updatedb"
|
"updatedb"
|
||||||
"--prunepaths=/tmp /var/tmp /gnu/store"))))
|
"--prunepaths=/tmp /var/tmp /gnu/store"))
|
||||||
|
"updatedb"))
|
||||||
|
|
||||||
(define garbage-collector-job
|
(define garbage-collector-job
|
||||||
;; Collect garbage 5 minutes after midnight every day.
|
;; Collect garbage 5 minutes after midnight every day.
|
||||||
|
@ -15948,6 +15949,14 @@ gexps to introduce job definitions that are passed to mcron
|
||||||
%base-services)))
|
%base-services)))
|
||||||
@end lisp
|
@end lisp
|
||||||
|
|
||||||
|
@quotation Tip
|
||||||
|
When providing the action of a job specification as a procedure, you
|
||||||
|
should provide an explicit name for the job via the optional 3rd
|
||||||
|
argument as done in the @code{updatedb-job} example above. Otherwise,
|
||||||
|
the job would appear as ``Lambda function'' in the output of
|
||||||
|
@command{herd schedule mcron}, which is not nearly descriptive enough!
|
||||||
|
@end quotation
|
||||||
|
|
||||||
For more complex jobs defined in Scheme where you need control over the top
|
For more complex jobs defined in Scheme where you need control over the top
|
||||||
level, for instance to introduce a @code{use-modules} form, you can move your
|
level, for instance to introduce a @code{use-modules} form, you can move your
|
||||||
code to a separate program using the @code{program-file} procedure of the
|
code to a separate program using the @code{program-file} procedure of the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue