Skip to content

Commit

Permalink
added cron job attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
kaimi committed Oct 15, 2013
1 parent 84e964b commit b95774f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,36 @@ Attributes
<td>where to write the cron job lockfile</td>
<td><tt>/tmp/rdiff-backup.lock</tt></td>
</tr>
<tr>
<td><tt>['rdiff-backup']['cron']['day']</tt></td>
<td>String</td>
<td>`day` component of the cron job definition</td>
<td><tt>*</tt></td>
</tr>
<tr>
<td><tt>['rdiff-backup']['cron']['hour']</tt></td>
<td>String</td>
<td>`hour` component of the cron job definition</td>
<td><tt>*</tt></td>
</tr>
<tr>
<td><tt>['rdiff-backup']['cron']['minute']</tt></td>
<td>String</td>
<td>`minute` component of the cron job definition</td>
<td><tt>*</tt></td>
</tr>
<tr>
<td><tt>['rdiff-backup']['cron']['month']</tt></td>
<td>String</td>
<td>`month` component of the cron job definition</td>
<td><tt>*</tt></td>
</tr>
<tr>
<td><tt>['rdiff-backup']['cron']['weekday']</tt></td>
<td>String</td>
<td>`weekday` component of the cron job definition</td>
<td><tt>*</tt></td>
</tr>
<tr>
<td><tt>['rdiff-backup']['autotrim']['enable']</tt></td>
<td>Boolean</td>
Expand Down
5 changes: 5 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
default['rdiff-backup']['cron']['enable'] = true
default['rdiff-backup']['cron']['email'] = "[email protected]"
default['rdiff-backup']['cron']['lockfile'] = "/tmp/rdiff-backup.lock"
default['rdiff-backup']['cron']['day'] = "*"
default['rdiff-backup']['cron']['hour'] = "23"
default['rdiff-backup']['cron']['minute'] = "0"
default['rdiff-backup']['cron']['month'] = "*"
default['rdiff-backup']['cron']['weekday'] = "*"

default['rdiff-backup']['autotrim']['enable'] = false
default['rdiff-backup']['autotrim']['timespan'] = "1y"
7 changes: 5 additions & 2 deletions recipes/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@

if node['rdiff-backup']['cron']['enable'] then
cron "backup" do
hour "23"
minute "0"
day node['rdiff-backup']['cron']['day']
hour node['rdiff-backup']['cron']['hour']
minute node['rdiff-backup']['cron']['minute']
month node['rdiff-backup']['cron']['month']
weekday node['rdiff-backup']['cron']['weekday']
if node['rdiff-backup']['cron']['email'] then
mailto node['rdiff-backup']['cron']['email']
end
Expand Down

0 comments on commit b95774f

Please sign in to comment.