Next: , Previous: , Up: Invoking   [Contents][Index]


4.1 Invoking mcron

Mcron should be run by the user who wants to schedule their jobs. It may be made a background job using the facilities of the shell. The basic command is mcron [OPTION ...] [file ...] which has the effect of reading all the configuration files specified (subject to the options) and then waiting until it is time to execute some command. If no files are given on the command line, then mcron will look in the user’s cron configuration directories: these are ~/.cron (deprecated), the directory indicated by the XDG_CONFIG_HOME environment variable, or ~/.config/cron if this variable is not set. In any case, files which end in the extension .vixie or .vix will be assumed to contain Vixie-style crontabs, and files ending .guile or .gle will be assumed to contain Scheme code and will be executed as such; ANY OTHER FILES WILL BE IGNORED - specify a file name of “-” and then pipe the files into the standard input if you really want to read them, possibly using the stdin option to specify the type of file.

The program accepts the following options.

-s count
--schedule=count

With this option specified no commands are run. Instead, the program computes the times the commands would be run and prints the information to the screen, and then immediately exits.

The count indicates the number of commands to display.

-d
--daemon

With this option the program will detach itself from the controlling terminal and run as a daemon process.

-i (vixie|guile)
--stdin=(vixie|guile)

This option is used to indicate whether the configuration information being passed on the standard input is in Vixie format or Guile format. Guile is the default.

--log-format

This option accepts an (ice-9 format) format string that can be used to customize the appearance of the output. The format string is applied to format with the following four arguments:

  1. A date/time string.
  2. The job process PID (as as number).
  3. The action name.
  4. The message to log.

It defaults to "~a ~2
~a: ~a~%"
, which produces output messages like:

2021-08-17T12:01:01 some-job: completed in 0.218s

If you’d rather see the job process PID instead of a timestamp, you could instead specify the format string as "~1
~a ~a: ~a~%"
, which would result in something like:

39234 some-job: completed in 0.218s

To learn about all the possibilities offered by (ice-9 format), refer to Formatted Output in GNU Guile Reference Manual.

--date-format

This option accepts a (srfi srfi-19) date string format, to customize the appearance of the timestamp in output messages. It defaults to "~5", which corresponds to a local ISO-8601 date/time format (see SRFI-19 Date to string in GNU Guile Reference Manual).

-v
--version

This option causes a message to be printed on the standard output with information about the version and copyright for the current program.

-h
--help

This causes a short but complete usage message to be displayed on standard output.


Next: , Previous: , Up: Invoking   [Contents][Index]