/puppet-cron

Puppet module for managing cron tasks

Primary LanguageRuby

cron

Table of Contents

  1. Description
  2. Setup - The basics of getting started with cron
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.

Description

The cron module provides resources for managing cron jobs in /etc/cron.d. Beyond just creating the cron files, it also deploys a cleaner script that removes jobs that are no longer managed by puppet.

Setup

Beginning with cron

To use the cron module, include it:

include cron

Usage

To create a new cron job, use the cron::entry defined resource type:

This example will run mycommand at 23 past the hour as user root.

cron::entry { 'my_job':
  command => '/usr/local/bin/mycommand > /dev/null',
  user => 'root',
  minute => '23',
}

Reference

This module uses puppet strings for documentation.

Limitations

As long as this module is used for generating cron entries, they will be cleaned up when they are no longer managed (that is, when the resource is removed from your puppet catalog). The cleanup script works by looking at all jobs with "pup" prefix, so if you do not want the cron job to be purged, you will need to rename it.