cron

Collection: builtin

Full Name: parallax.builtin.cron

Aliases: ansible.builtin.cron, cron

Synopsis

Manage cron

Parameters

NameTypeRequiredDefaultDescription
namestringyesDescription of the crontab entry or the job name to manage
jobstringThe command to execute (required unless state=absent)
statestringpresentabsent or present: whether to ensure the cron job is absent or present
minutestring*Minute field for the cron job (0-59, *, */n)
hourstring*Hour field for the cron job (0-23, *, */n)
daystring*Day of month field for the cron job (1-31, *, */n)
monthstring*Month field for the cron job (1-12, *, */n)
weekdaystring*Weekday field for the cron job (0-7, *, */n)
special_timestringSpecial time specification Choices: annually, daily, hourly, monthly, reboot, weekly, yearly
userstringrootThe specific user whose crontab should be modified
cron_filestringWrite cron job to a specific file in /etc/cron.d
backupboolfalseCreate a backup of the crontab before making changes
disabledboolfalseDisable the cron job by commenting it out
envboolfalseIf true, manage environment variable assignments in crontab
insertafterstringIf specified, insert job after the matching line
insertbeforestringIf specified, insert job before the matching line
rebootboolfalseRun job at reboot (alias for special_time=reboot)
minute_aliasstringAlias for minute parameter (for compatibility)
hour_aliasstringAlias for hour parameter (for compatibility)
day_aliasstringAlias for day parameter (for compatibility)
month_aliasstringAlias for month parameter (for compatibility)
weekday_aliasstringAlias for weekday parameter (for compatibility)

Example

- name: Example cron task
  cron:
    name: <your_name>