Sunday, July 31, 2016

Generate a cronjob for wake up alarm



kirandspuppet: / >
kirandspuppet: / >
kirandspuppet: / > crontab -l
no crontab for root
kirandspuppet: / >
kirandspuppet: / >
kirandspuppet: / > vi /etc/puppet/manifests/echo-alarm.pp
kirandspuppet: / >
kirandspuppet: / > cat /etc/puppet/manifests/echo-alarm.pp
cron {'cron-alarm':
ensure        =>    'present',
command        =>    '/bin/echo "Wake up!!! Wake up, it is getting late!!!"',
minute        =>    ['5'],
target        =>    'root',
user        =>    'root',
}
kirandspuppet: / >
kirandspuppet: / >
kirandspuppet: / > puppet apply /etc/puppet/manifests/echo-alarm.pp
Fact file /etc/puppet/modules/team_custom_facts/facts.d/README was parsed but returned an empty data set
Notice: Compiled catalog for kirandspuppet.eng.company.com in environment production in 0.05 seconds
Notice: /Stage[main]/Main/Cron[cron-alarm]/ensure: created
Notice: Finished catalog run in 0.05 seconds
kirandspuppet: / >
kirandspuppet: / >
kirandspuppet: / > crontab -l
# HEADER: This file was autogenerated at Sun Nov 15 18:37:06 -0800 2015 by puppet.
# HEADER: While it can still be managed manually, it is definitely not recommended.
# HEADER: Note particularly that the comments starting with 'Puppet Name' should
# HEADER: not be deleted, as doing so could cause duplicate cron jobs.
# Puppet Name: cron-alarm
5 * * * * /bin/echo "Wake up!!! Wake up, it is getting late!!!"
kirandspuppet: / >
kirandspuppet: / >








No comments:

Post a Comment