cronrun - convenience features to run commands in task scheduler environment


NAME

cronrun - convenience features to run commands in task scheduler environment


SYNOPSIS

cronrun [OPTIONS] <COMMAND> [ARGS]

Run COMMAND in a way most scheduled jobs are intended to run, ie:

Set computing priority (nice(1), ionice(1)) to low
Delay start for random amount of time, thus avoiding load-burst when multiple jobs start at the same time
Allow only one instance at a time (by locking)


OPTIONS

--random-delay, -d TIME

Delay program execution at most TIME amount of time. Default is to wait nothing. Also can be set by CRONRUN_DELAY environment.

TIME is a series of AMOUNT and UNIT pairs after each other without space, ie:

 I<AMOUNT> I<UNIT> [ I<AMOUNT> I<UNIT> [ I<AMOUNT> I<UNIT> [...] ] ]

Where UNIT is s, m, h, d for seconds, minutes, hours, days respectively.

Example: 1h30m

A single number without UNIT is seconds.

--wait-lock, -W

Wait for the lock to release. By default cronrun(1) fails immediately if locked.


DESCRIPTION

Lock is based on CRONJOBID environment, or COMMAND if CRONJOBID is not set.

If CRONJOBID is set, STDIO goes to syslog too, in the "cron" facility, stdout at info level, stderr at error level. If not set, STDIO is not redirected.


FILES

~/.cache/cronrun

Lock files stored in this directory.


ENVIRONMENT

CRONJOBID

Recommended practice is to set CRONJOBID=something in your crontab before each cronrun ... job definition.

CRONRUN_DELAY

Set value for the --random-delay option.


LIMITATIONS


SEE ALSO

 cronrun - convenience features to run commands in task scheduler environment