Skip to content

Commit

Permalink
Merge pull request #5905 from chu11/issue5600_cron_doc
Browse files Browse the repository at this point in the history
doc: various minor flux-cron(1) fixes and improvements
  • Loading branch information
mergify[bot] committed Apr 24, 2024
2 parents d8b86fd + dbed481 commit 8562f82
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
39 changes: 32 additions & 7 deletions doc/man1/flux-cron.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ SYNOPSIS
| **flux** **cron** **event** [*-E*] [*-d* *DIR*] [*-o* *OPT...*] *topic* *command*
| **flux** **cron** **interval** [*-E*] [*-d* *DIR*] [*-o* *OPT...*] *interval* *command*
| **flux** **cron** **list** [*ids...*]
| **flux** **cron** **list**
| **flux** **cron** **stop** *ids...*
| **flux** **cron** **start** *ids...*
| **flux** **cron** **delete** [*--kill*] *ids...*
| **flux** **cron** **dump** [*--key=KEY*] *ids...*
| **flux** **cron** **sync** [*--disable*] [*--epsilon=TIME*] *ids...*
| **flux** **cron** **sync** [*--disable*] [*--epsilon=TIME*] *topic*

DESCRIPTION
Expand Down Expand Up @@ -93,7 +93,8 @@ at

.. program:: flux cron at

Run *command* at specific date and time described by *time*.
Run *command* at specific date and time described by *time*. Any time
string that can be parsed by :linux:man1:`date` is acceptable.

.. option:: -o, options=LIST

Expand Down Expand Up @@ -160,16 +161,19 @@ interval

Create a cron entry to execute *command* every *interval*, where *interval*
is an arbitrary floating point duration with optional suffix *s* for
seconds, *m* for minutes, *h* for hours and *d* for days.
seconds, *m* for minutes, *h* for hours and *d* for days. If no suffix is
specified, seconds is assumed.

.. option:: -n, --name=STRING

Set a name for this cron entry to *STRING*.

.. option:: -a, --after=TIME

The first task will run after a delay of *TIME* instead of *interval*.
After the first task the entry will continue to execute every *interval*.
The first task will run after a delay of *TIME* instead of *interval*, where
*TIME* is an arbitrary floating point duration specified in the same format
as *interval*. After the first task the entry will continue to execute
every *interval*.

.. option:: -c, --count=N

Expand Down Expand Up @@ -361,12 +365,33 @@ tuned via the :option:`--task-history-count` option, described in the
EXTRA OPTIONS section.

Commands are normally executed immediately on the interval or event
trigger for which they are configured. However, if the :option:`--sync-event`
trigger for which they are configured. However, if the :option:`sync`
option is active on the cron module, tasks execution will be deferred
until the next synchronization event. See the documentation above
for :program:`flux cron sync` for more information.


EXAMPLES
========

Run a script every hour

::

$ flux cron interval 1h my_script.sh
interval: cron-1 created

Run a script only when the event "cron.trigger" is published

::

$ flux cron event cron.trigger my_script.sh
event: cron-2 created
...
$ flux event pub cron.trigger



RESOURCES
=========

Expand Down
4 changes: 2 additions & 2 deletions src/cmd/flux-cron
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ end
program:SubCommand {
name = "dump",
description = "Dump values from a cron entry",
usage = "[IDs]",
usage = "IDs",
options = {
{ name = "key", char = "k", arg = "KEY",
usage = "Print only KEY from the entry",
Expand Down Expand Up @@ -415,7 +415,7 @@ program:SubCommand {
program:SubCommand {
name = "list",
description = "List registered and stopped flux-cron jobs",
usage = "[IDs]",
usage = "",
options = {},
handler = function (self, arg)

Expand Down

0 comments on commit 8562f82

Please sign in to comment.