Module cron

Ensure that a cron job is present or absent in a user's crontab.


Only tested with vixie-cron, Busybox cron, Alpine dcron.

Info:

Functions

present(job, user, minute, hour, day, weekday, month)
Add a job to a user's crontab.
Cron jobs that does not match its tag are replaced.
See crontab(5)

Promiser:

    tag to track jobs

Parameters:

  • job the command or job to add [REQUIRED]
  • user user login to operate on [DEFAULT: "root"]
  • minute minute value [DEFAULT: "*"]
  • hour hour value [DEFAULT: "*"]
  • day day value [DEFAULT: "*"]
  • weekday weekday value [DEFAULT: "*"]
  • month month value [DEFAULT: "*"]

Usage:

    cron.present("example"){
            job = "/bin/ls",
         minute = "5",
           hour = "3",
            day = "2",
        weekday = "2",
          month = "5",
           user = "ed"
    }
absent(job, user)
Remove a job from a user's crontab.

Promiser:

    tag to track jobs

Parameters:

  • job the command or job string [REQUIRED]
  • user user login to operate on [DEFAULT: "root"]

Usage:

    cron.absent("example"){
         job = "/bin/ls",
        user = "ed"
    }
generated by LDoc 1.4.6 Last updated 2017-05-09 15:50:38