Skip to content

Instantly share code, notes, and snippets.

@sawanoboly
Last active August 29, 2015 14:00
Show Gist options
  • Select an option

  • Save sawanoboly/11511054 to your computer and use it in GitHub Desktop.

Select an option

Save sawanoboly/11511054 to your computer and use it in GitHub Desktop.
ChefのCronリソースがPredefined scheduling指定に対応した ref: http://qiita.com/sawanoboly/items/570711f1fd19c504474a
$ 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]
cron 'at_reboot' do
command '/bin/true'
time :reboot
end
$ sudo crontab -l -u root
# Chef Name: at_reboot
@reboot /bin/true
SPECIAL_TIME_VALUES = [:reboot, :yearly, :annually, :monthly, :weekly, :daily, :midnight, :hourly]
$ 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