Last active
August 29, 2015 14:00
-
-
Save sawanoboly/11511054 to your computer and use it in GitHub Desktop.
ChefのCronリソースがPredefined scheduling指定に対応した ref: http://qiita.com/sawanoboly/items/570711f1fd19c504474a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ chef-client -v | |
| Chef: 11.12.4 | |
| $ sudo chef-apply cron.rb | |
| Recipe: (chef-apply cookbook)::(chef-apply recipe) | |
| * cron[at_reboot] action create | |
| - add crontab entry for cron[at_reboot] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cron 'at_reboot' do | |
| command '/bin/true' | |
| time :reboot | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo crontab -l -u root | |
| # Chef Name: at_reboot | |
| @reboot /bin/true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SPECIAL_TIME_VALUES = [:reboot, :yearly, :annually, :monthly, :weekly, :daily, :midnight, :hourly] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo chef-apply cron.rb | |
| Recipe: (chef-apply cookbook)::(chef-apply recipe) | |
| * cron[at_reboot] action delete | |
| - save unmodified crontab | |
| ## ?? unmodified ?? | |
| $ sudo crontab -l -u root | |
| @reboot /bin/true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment