cookbook 'cron', '= 6.4.0'
cookbook 'cron', '= 6.4.0', :supermarket
knife supermarket install cron
knife supermarket download cron
Installs the cron package and starts the crond service.
Note: Chef 14.4 shipped with the cron_d and cron_access (cron_manage) resources. When Chef 15.4 ships in Aug 2019 these resources will be removed from this cookbook as all users should be on Chef 14.4 or later.
This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.
- RHEL family
- Debian family
- Solaris family
- SUSE family
- Chef 12.7+
cron_d custom resource can be used to manage files in
/etc/cron.d. It supports the same interface as Chef's built-in
cron_name- Set the name of the cron job. If this isn't specified we'll use the resource name.
weekday- schedule your cron job. These correspond exactly to their equivalents in the crontab file. All default to "*".
predefined_value- schedule your cron job with one of the special predefined value instead of ** * pattern. This correspond to
command- the command to run. Required.
user- the user to run as. Defaults to "root".
random_delay- set the corresponding environment variables in the cron.d file. No default.
environment- a Hash containing additional arbitrary environment variables under which the cron job will be run (similar to the
shellLWRP). No default.
comment- A comment to place in the cron.d file
mode- the octal mode of the generated crontab file. Defaults to
cron_d 'daily-usage-report' do minute 0 hour 23 command '/srv/app/scripts/daily_report' user 'appuser' end
cron_d 'Setup the daily usage cron job' do cron_name 'daily-usage-report' minute 0 hour 23 command '/srv/app/scripts/daily_report' user 'appuser' end
cron_access resource can be used to manage the
Note: This resource was previously a Chef definition cron_manage. The legacy name will still function, but should be updated.
:deny- Add the user to the cron.deny file (default).
:allow- Add the user to the cron.allow file.
user- username that you want to control. If not provided the resource name will be used as the user.
The following will add the user mike to the
cron_access 'mike' do action :allow end
The following will add the user john to the
cron_access "Make sure john can't touch cron" do user 'john' action :deny #optional, deny is the default end
This project exists thanks to all the people who contribute.
Thank you to all our backers!
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
This cookbook has no specified dependencies.
cron Cookbook CHANGELOG
This file is used to list changes made in each version of the cron cookbook.
6.4.0 - 2021-01-24
- Sous Chefs Adoption
- Standardise files with files in sous-chefs/repo-management
- Ensure we have both resource_name and provides in resources - @tas50
- Expand tests and fix Amazon tests - @tas50
- Update copyrights - @tas50
- Remove support for SLES 11 and simplify package logic - @tas50
- Update specs for newer platforms - @tas50
- Simplify platform check logic - @tas50
- Require Chef 12.15+ - @tas50
- Update platforms we test on - @tas50
- Update how we define the resource names / provides - @tas50
- Added a note to the readme announcing the deprecation of the cron_d and cron_access resources in this cookbook. As both of these resources shipped in Chef 14.4 they will be deprecated when Chef 15.4 ships in Aug 2019.
- Finish the random_delay property begun in
- Add missing type for cron_name property
- Add specs for additional platforms
- Faise with a better message on non-Linux platforms in the cron_d resource
- Converted chef_manage definition to a custom resource using the accumulator pattern. This will allow for reporting and notification from these resources as they are now real resources. The existing cron_manage name was changed to cron_access, but the existing name will continue to function.
- Remove the file used with monolithic cron file hosts to fake cron.d. This was unused since 6.0 removed that functionality.
- The cron_d resource no longer provides crontab emulation on FreeBSD or Solaris. This is outside the scope of this resource and users on platforms without cron.d support should instead use Chef's build in cron resource which manages the monolithic cron config.
- define pld linux package and service name used for cron
- Simplify how we validate the predfined_value property to provide better error messages
- Add a name_property if you want a more descriptive resource name
- Make sure cron files are 0600 not 0644 for CIS compliance
- Document the comment property in the readme
- Create a single test suite to speed up testing
- Add support for Amazon Linux 2.0
- Remove Chef 12 testing since Chef 12 goes EOL in just a few weeks
- Test Amazon Linux / Ubuntu 18.04 and Chef 14
- Remove ChefSpec matchers since these are autogenerated now. If this causes failurs then you need to update to the latest ChefDK release
- Remove the redundant name property in the cron_d resource
- Require Chef 12.7+ and remove compat_resource dependency
- Improve the readme layout
- Update Travis CI testing to test Chef 12/13 and also Debian 9
- Activate RANDOMDELAY in cron.d template
- Add support and testing for SLES 11
- Update and improve testing setup
- Converting integration testing to InSpec
- Remove class_eval usage
- Require Chef 12.1 not 12.5 since we use compat_resource
- Ensure compatibility with Chef 12.5-12.6
- chef-client 13 amazon linux fix
- Move files out of default dirs since only Chef 11 required that
- Fix the namespacing and cookstyle violations in validators (Fixes #80)
- Add compat_resource depends so that Chef 12.5 is really supported
- Remove the hostname from templates
- Rename the test cookbook to test
- make env variables safe if they span lines
- Convert cron_d from a LWRP to a custom resource, which raises the requirement for chef-client to 12.5+
- Fix failures on Suse and add it to the readme/metadata as a supported platform
- Test with Local Delivery and not Rake
- Remove support for Arch and Gentoo as we lack the ability to test these platforms
- Fix the installation of the core-os package on Solaris
- Update supported OS releases in the readme
- Switch to kitchen-dokken and test on more platforms
- Resolve foodcritic warnings
- Split out unit testing in travis and use the rakefile with cookstyle
- Require chef 12.1
- Properly define the chefspec matcher
- Use multipackage for installs
- Cleanup the cron.d jobs with the non-santized filenames to prevent duplicate job jobs if cron < 1.7.4 was ever run on the node
* is not valid value for validate_numericerrors
- Sanitize cron job names in the custom resource to replace '.' with '-'
- Re-release to remove DS Store file that snuck in
- Fixed the inability to delete a cron job without specifying the command. Expanded tests to cover this scenario and the create_if_missing action
- #65 - Added action create_if_missing for cron jobs you want to create, but not modify later
- Added Arch Linux support
- Added FreeBSD support, which emulates /etc/cron.d folder support and builds a single /etc/crontab file using the contents of /etc/cron.d
- Ensure that the cron package is installed on Debian based systems
- Updated Kitchen CI to use new format and additional platforms
- Added standard Rubocop config for Chef managed cookbooks and resolved all warnings
- Added Travis CI testing for foodcritic, rubocop, and chefspec
- Added Serverspec tests for Kitchen CI
- Updated Berkfile to the latest format
- Updated contributing and testing documentation
- Updated Gemfile dependencies to the latest releases of testing gems
- Removed pre-1.9 Ruby hash rocket syntax
- Added maintainers.md and maintainers.toml files
- Added cookbook version and Travis CI badges to the readme
- Clarified that the minimum supported Chef release is 11.0
- Added a Rakefile for easier testing
- Added chefignore file to limit what files are uploaded to the Chef server
- Added long_description to the metadata.rb file
- Added source_url and issues_url to the metadata.rb file for Supermarket
- Updated Chefspec for 4.X format
- [#48] fix typo apry -> apr
-  Add environment parameter to LWRP
-  Allow user to specify file permissions
- [#25] Fixes NameError exception on :delete
- [#33] Updates README
- [#40] Fixes local test-kitchen config
- [#20] Implements a comment for cron_d provider
- [#46] Fixes a broken case statement causing cron_d to fail
- [#31] Fix up validate_month for Fixnums
- [#32] Fix upvalidate_dow for Fixnums
- [COOK-4628] Adding cron_manage to allow or deny users
- [COOK-4550] - cron_d resource sometimes does not print the time in the cron output
- PR #23 fix validate month and dow
- Updating test harness, adding specs
- [COOK-4507] - restore ability to use @ fields
- [COOK-4544] fixing NameError exception on :delete action
- [COOK-4337] fixing validations
- Reverting [COOK-4337] - cron cookbook does no input validation
- [COOK-4337] - cron cookbook does no input validation
- [COOK-4229] - Support the Gentoo package
- COOK-4112 - Solaris 11 support for cron
- COOK-3813 - Add metadata for recipes in the cron cookbook
- COOK-3452 - Add support for raspbian platform
- COOK-3005 - Remove blankline in template
- [COOK-3058]: simplify conditionals in cron recipe
- [COOK1829] -
cron_dLWRPtemplate should imply cron cookbook by default
- [COOK-938] - don't default to upgrading cron and fix rhel6 package name
- [COOK-1622] - add LWRP for cron.d files
- [COOK-1514] - Cron cookbook manages wrong service name on SuSE
- [COOK-1124] - add RHEL platform support