Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ This module defines the following types:

* `cron::job` - basic job resource
* `cron::job::multiple` - basic job resource for multiple jobs per file
* `cron::hourly` - wrapper for hourly jobs
* `cron::daily` - wrapper for daily jobs
* `cron::weekly` - wrapper for weekly jobs
* `cron::monthly` - wrapper for monthly jobs
* `cron::job::hourly` - wrapper for hourly jobs
* `cron::job::daily` - wrapper for daily jobs
* `cron::job::weekly` - wrapper for weekly jobs
* `cron::job::monthly` - wrapper for monthly jobs

## Installation

Expand Down Expand Up @@ -224,9 +224,9 @@ PATH="/usr/sbin:/usr/bin:/sbin:/bin"
@reboot root /usr/bin/sleep 10
```

### cron::hourly
### cron::job::hourly

`cron::hourly` creates jobs in `/etc/cron.d` that run once per hour.
`cron::job::hourly` creates jobs in `/etc/cron.d` that run once per hour.
It allows specifying the following parameters:

* `ensure` - optional - defaults to "present"
Expand All @@ -241,7 +241,7 @@ Example:
This would create the file `/etc/cron.d/mysqlbackup_hourly` and run the command `mysqldump -u root mydb` as root on the 20th minute of every hour:

```puppet
cron::hourly { 'mysqlbackup_hourly':
cron::job::hourly { 'mysqlbackup_hourly':
minute => '20',
user => 'root',
command => 'mysqldump -u root mydb',
Expand All @@ -253,7 +253,7 @@ Hiera example:

```yaml
---
cron::hourly:
cron::job::hourly:
'mysqlbackup_hourly':
minute: 20
user: root
Expand All @@ -263,9 +263,9 @@ cron::hourly:
- 'PATH="/usr/bin:/bin"'
```

### cron::daily
### cron::job::daily

`cron::daily` creates jobs in `/etc/cron.d` that run once per day.
`cron::job::daily` creates jobs in `/etc/cron.d` that run once per day.
It allows specifying the following parameters:

* `ensure` - optional - defaults to "present"
Expand All @@ -281,7 +281,7 @@ Example:
This would create the file `/etc/cron.d/mysqlbackup_daily` and run the command `mysqldump -u root mydb` as root at 2:40 AM every day, like the above generic example:

```puppet
cron::daily { 'mysqlbackup_daily':
cron::job::daily { 'mysqlbackup_daily':
minute => '40',
hour => '2',
user => 'root',
Expand All @@ -293,7 +293,7 @@ Hiera example:

```yaml
---
cron::daily:
cron::job::daily:
'mysqlbackup_daily':
minute: 40
hour: 2
Expand All @@ -302,9 +302,9 @@ cron::daily:
```


### cron::weekly
### cron::job::weekly

`cron::weekly` creates jobs in `/etc/cron.d` that run once per week.
`cron::job::weekly` creates jobs in `/etc/cron.d` that run once per week.
It allows specifying the following parameters:

* `ensure` - optional - defaults to "present"
Expand All @@ -321,7 +321,7 @@ Example:
This would create the file `/etc/cron.d/mysqlbackup_weekly` and run the command `mysqldump -u root mydb` as root at 4:40 AM every Sunday, like the above generic example:

```puppet
cron::weekly { 'mysqlbackup_weekly':
cron::job::weekly { 'mysqlbackup_weekly':
minute => '40',
hour => '4',
weekday => '0',
Expand All @@ -334,7 +334,7 @@ Hiera example:

```yaml
---
cron::weekly:
cron::job::weekly:
'mysqlbackup_weekly':
minute: 40
hour: 4
Expand All @@ -344,9 +344,9 @@ cron::weekly:
```


### cron::monthly
### cron::job::monthly

`cron::monthly` creates jobs in `/etc/cron.d` that run once per month.
`cron::job::monthly` creates jobs in `/etc/cron.d` that run once per month.
It allows specifying the following parameters:

* `ensure` - optional - defaults to "present"
Expand All @@ -363,7 +363,7 @@ Example:
This would create the file `/etc/cron.d/mysqlbackup_monthly` and run the command `mysqldump -u root mydb` as root at 3:40 AM the 1st of every month, like the above generic example:

```puppet
cron::monthly { 'mysqlbackup_monthly':
cron::job::monthly { 'mysqlbackup_monthly':
minute => '40',
hour => '3',
date => '1',
Expand All @@ -376,7 +376,7 @@ Hiera example:

```yaml
---
cron::monthly:
cron::job::monthly:
'mysqlbackup_monthly':
minute: 40
hour: 3
Expand Down
6 changes: 3 additions & 3 deletions manifests/daily.pp → manifests/job/daily.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Type: cron::daily
# Type: cron::job::daily
#
# This type creates a daily cron job via a file in /etc/cron.d
#
Expand Down Expand Up @@ -27,14 +27,14 @@
# Requires:
#
# Sample Usage:
# cron::daily { 'mysql_backup':
# cron::job::daily { 'mysql_backup':
# minute => '1',
# hour => '3',
# environment => [ 'PATH="/usr/sbin:/usr/bin:/sbin:/bin"' ],
# command => 'mysqldump -u root my_db >/backups/my_db.sql',
# }
#
define cron::daily (
define cron::job::daily (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a breaking change for users who aren't using hiera but defining cron::daily resources directly in their manifests.

Optional[String[1]] $command = undef,
Enum['absent','present'] $ensure = 'present',
Variant[Integer,String[1]] $minute = 0,
Expand Down
6 changes: 3 additions & 3 deletions manifests/hourly.pp → manifests/job/hourly.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Type: cron::hourly
# Type: cron::job::hourly
#
# This type creates an hourly cron job via a file in /etc/cron.d
#
Expand All @@ -24,13 +24,13 @@
# Requires:
#
# Sample Usage:
# cron::hourly { 'generate_puppetdoc':
# cron::job::hourly { 'generate_puppetdoc':
# minute => '1',
# environment => [ 'PATH="/usr/sbin:/usr/bin:/sbin:/bin"' ],
# command => 'puppet doc >/var/www/puppet_docs.mkd',
# }
#
define cron::hourly (
define cron::job::hourly (
Optional[String[1]] $command = undef,
Enum['absent','present'] $ensure = 'present',
Variant[Integer,String[1]] $minute = 0,
Expand Down
6 changes: 3 additions & 3 deletions manifests/monthly.pp → manifests/job/monthly.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Type: cron::monthly
# Type: cron::job::monthly
#
# This type creates a monthly cron job via a file in /etc/cron.d
#
Expand Down Expand Up @@ -30,15 +30,15 @@
# Requires:
#
# Sample Usage:
# cron::monthly { 'delete_old_log_files':
# cron::job::monthly { 'delete_old_log_files':
# minute => '1',
# hour => '7',
# date => '28',
# environment => [ 'MAILTO="admin@example.com"' ],
# command => 'find /var/log -type f -ctime +30 -delete',
# }
#
define cron::monthly (
define cron::job::monthly (
Optional[String[1]] $command = undef,
Enum['absent','present'] $ensure = 'present',
Variant[Integer,String[1]] $minute = 0,
Expand Down
6 changes: 3 additions & 3 deletions manifests/weekly.pp → manifests/job/weekly.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Type: cron::weekly
# Type: cron::job::weekly
#
# This type creates a cron job via a file in /etc/cron.d
#
Expand Down Expand Up @@ -30,15 +30,15 @@
# Requires:
#
# Sample Usage:
# cron::weekly { 'delete_old_temp_files':
# cron::job::weekly { 'delete_old_temp_files':
# minute => '1',
# hour => '4',
# weekday => '7',
# environment => [ 'MAILTO="admin@example.com"' ],
# command => 'find /tmp -type f -ctime +7 -delete',
# }
#
define cron::weekly (
define cron::job::weekly (
Optional[String[1]] $command = undef,
Enum['absent','present'] $ensure = 'present',
Variant[Integer,String[1]] $minute = 0,
Expand Down