runwhen is a set of utilities for running commands at particular times. With these tools, you can perform calculations on time values in various ways, and use those calculated times to determine how long a process should sleep before performing some task.
This package is discussed on the prjware list. New releases are announced on the prjware-announce list.
runwhen is devoid of warranty and is distributed under the GNU General Public License, version 2. But that doesn't mean it's necessarily a good idea for you to distribute modified versions. (That includes repackaging.) I'd like to know if you plan to do that.
This link always points to the latest version (currently 2021.04.30).
Older versions are published for historical interest.
You can get the latest development sources with:
$ git clone git://git.dogmap.org/runwhen.git
To build runwhen, you need Laurent Bercot's
skalibs package.
Edit conf-compile/depend_*
as necessary during installation.
Aside from the obsolete commands, runwhen is believed to work with both TAI
clocks and POSIX clocks. (TAI-clock systems should use a right/
time zone and have /etc/leapsecs.dat
; POSIX-clock systems
should use a non-right/
time zone and have no
/etc/leapsecs.dat
.)
slashpackage is a good thing. You can
read more about it
here. If you don't already have /package
, create it (on any
filesystem you like, as long as it's accessible by the name
“/package
”):
# mkdir -p /usr/local/package # ln -s /usr/local/package / # chmod +t /package/.
Then run sp-install
:
# sp-install runwhen-VERSION.tar.bz2
Or, if you like to do things manually, unpack the tarball and run
package/install
:
# cd /package # bunzip2 < /path/to/runwhen-VERSION.tar.bz2 | > tar -xpf - # cd admin/runwhen-VERSION # package/install
Read package/README
and package/INSTALL
for more
detailed instructions.
rw-sleep
program sleeps until
a given time and executes a given command.
rw-add
program computes the sum
of two timestamps.
rw-sub
program computes the
difference of two timestamps.
rw-min
program computes the
smaller of two timestamps.
rw-max
program computes the
larger of two timestamps.
rw-match
program computes a
timestamp matching given constraints.
rw-touch
program updates a
file's last-modified time.
Obsolete commands, no longer in the current version:
delayrun
program sleeps for
$DELAY
seconds and executes a given command.
caldelay
program sets
$DELAY
to make delayrun wake up at a given calendar
time.
maxinterval
program applies
a lower bound to $DELAY
.
mininterval
program applies
an upper bound to $DELAY
.
None.
rw-match
-like tool to find the nearest
past time matching some criteria.
,w
and ,d
/,m
/,y
should be able to be used together in rw-match
.