crontab and mailto

598 views
Skip to first unread message

Rupert

unread,
Jul 15, 2009, 5:05:16 AM7/15/09
to Puppet Users
Hello,

is there a way to specify a mailto directive for a block of cronjobs?
Right now I have the same email address in 4 cronjobs, i would like to
defide that address only on the beginning fo such block.


thnx

.r

jcbollinger

unread,
Jul 15, 2009, 12:19:24 PM7/15/09
to Puppet Users
I'm not clear on how you're specifying an e-mail address now, because
the built in Cron resource does not have a property for it. If you
are using the 'environment' property then I think you can define a
property default within an enclosing scope:

class cronjobs {
Cron { environment => "MAILTO=m...@mymail.com" }

cron { "mycommand":
command => "/usr/local/bin/mycommand",
hour => 3,
}

cron { "yourcommand":
command => "/usr/local/bin/yourcommand",
hour => 4,
}
}

If that works for you then I don't think you can do better.
Reply all
Reply to author
Forward
0 new messages