- Description
- Setup - The basics of getting started with cron
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
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.
To use the cron
module, include it:
include cron
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',
}
This module uses puppet strings for documentation.
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.