X-Git-Url: http://git.annexia.org/?p=whenjobs.git;a=blobdiff_plain;f=tools%2Fwhenjobs.pod;h=85da381eaa671a288593e451dc1164fb77b0e5be;hp=466bdb1bbd87b4d64cf12e2f572115862b041b49;hb=7724a64945c4f485780ed052de17793287e1935b;hpb=03b83c1a4bab53d8914c6946ad892bca30df09d0 diff --git a/tools/whenjobs.pod b/tools/whenjobs.pod index 466bdb1..85da381 100644 --- a/tools/whenjobs.pod +++ b/tools/whenjobs.pod @@ -14,7 +14,7 @@ Editing the jobs script: Get and set variables: whenjobs --get variable - whenjobs --set variable value [--type bool|int|float|string] + whenjobs --set variable=value [variable=value ...] whenjobs --variables Start and stop the per-user daemon: @@ -43,7 +43,7 @@ Periodic jobs are written like this: << # Get the current load average. load=`awk '{print $1}' /proc/loadavg` - whenjobs --set load $load --type float + whenjobs --set --type float load=$load >> When-statements let you create jobs that run based on variables set @@ -80,7 +80,7 @@ command line tool to examine and set variables: $ whenjobs --variables load=0.9 - $ whenjobs --set cat sushi + $ whenjobs --set cat=sushi $ whenjobs --get cat sushi @@ -127,6 +127,11 @@ C is used. Print the value of a variable. +=item B<--job-names> + +List the names of all loaded jobs (whether they are running or not). +Use I<--jobs> to list running jobs. + =item B<--jobs> List all running jobs. @@ -150,7 +155,7 @@ source, eg: whenjobs --lib $builddir/lib -e -=item B<--set> variable value +=item B<--set> variable=value [variable=value ...] =item B<--type> bool|int|float|string|unit @@ -158,18 +163,33 @@ I<--set> sets the variable named C to the new C. The variable is created if it does not already exist. Note that setting a variable can cause jobs to run immediately. -To unset a variable, set it to the empty string: +To unset a variable, set it to the empty string like this: - whenjobs --set var "" + whenjobs --set var= By default variables are strings. You can also set the type of a -variable when setting it by adding the optional I<--type> parameter: +variable when setting it by adding the optional I<--type> parameter. +The I<--type> parameter should come I the variable +declaration, like this: - whenjobs --set free_space 10000 --type int + whenjobs --set --type int free_space=10000 See the discussion of variable types in the L section below. +You can set multiple variables. When setting multiple variables in a +single command, the values are all changed in a single atomic +operation. + + whenjobs --set cat=sushi food=fish + +When using I<--type> and multiple variables, the type changes the +remaining command line parameters until the next I<--type>, eg: + + whenjobs --set cat=sushi --type float weight=3.5 --type string food=fish + +(C and C are strings, and C is a float). + =item B<--start> "job name" Start the job immediately and unconditionally. @@ -182,6 +202,17 @@ may cause unexpected results, so use with caution. Tail the output of the running job identified by its serial number. Use the I<--jobs> flag to get a list of running jobs. +=item B<--test> variable=value [variable=value ...] + +This works the same way as the I<--set> option, but the difference is +that the variables are not set. Instead, it lists out the jobs that +I run, I the variables were updated to these new values. + +The variables are not actually updated, and the jobs are not actually +run. + +The output is a list of job names that would run. + =item B<--upload> Compile the jobs script and upload it to the daemon, without editing.