cron_add: Make a simple cron job

Description Usage Arguments Details

Description

Generate a cron job, and pass it to crontab.

Usage

1
2
3
4
5
cron_add(command, frequency = "daily", at, days_of_month, days_of_week,
  months, id, tags = "", description = "", dry_run = FALSE, user = "")

cronjob(command, frequency = "daily", at, days_of_month, days_of_week, months,
  id, tags = "", description = "", dry_run = FALSE, user = "")

Arguments

command

A command to execute.

frequency

A character string equal to one of "minutely", "hourly", "daily", "monthly", or "yearly".

at

The actual time of day at which to execute the command. When unspecified, we default to "3AM", when the command is to be run less frequently than "hourly".

days_of_month

Optional; the day(s) of the month on which we execute the command.

days_of_week

Optional; the day(s) of the week on which we execute the command.

months

Optional; the month(s) of the year on which we execute the command.

id

An id, or name, to give to the cronjob task, for easier revision in the future.

tags

A set of tags, used for easy listing and retrieval of cron jobs.

description

A short description of the job, and its purpose.

dry_run

Boolean; if TRUE we do not submit the cron job; instead we return the parsed text that would be submitted as a cron job.

user

The user whose cron jobs we wish to examine.

Details

The goal is to be able to translate simple English statements of intent to the actual cron statement that could execute that intent. For example,

"I want to run a job daily at 7AM."

is simply

cron_add(<command>, "daily", at="7AM")

Another example, "I want to run a job on the 15th of every month."

is

cron_add(<command>, "monthly", days_of_month="15th")


kevinushey/cronR documentation built on May 20, 2019, 9:09 a.m.