Next: , Previous: , Up: Simple examples   [Contents][Index]

2.1 Guile

You have an executable my-program in your home directory, which you want to run every hour. Create a file job.guile in directory ~/.config/cron (this path may be altered by the $XDG_CONFIG_HOME environment variable) with the following contents

(job '(next-hour) "my-program")

then run the command mcron.

Want the program to run fifteen minutes past the hour, every two hours? Edit the file to read

      (next-hour (range 0 24 2))

and run the command mcron.

Or, if you are not comfortable with Scheme, you could use (and see also the next section)

(job "15 */2 * * *" "my-program")

and run the mcron command.

If you want to run other jobs, you can either add more lines to this file, or you can create other files in your .config/cron directory with the .guile extension. Alternatively, you can use any file you want and pass it as an argument to mcron, or even pipe the commands into the standard input.