Coder Social home page Coder Social logo

cron's Introduction

cron Cookbook

Installs the cron package and starts the crond service.

Requirements

Platforms:

  • RHEL family
  • Debian family
  • Solaris family
  • Gentoo

Resources and Providers

cron_d

The cron_d LWRP can be used to manage files in /etc/cron.d. It supports the same interface as Chef's built-in cron resource:

cron_d 'daily-usage-report' do
  minute  0
  hour    23
  command '/srv/app/scripts/daily_report'
  user    'appuser'
end

Note: This LWRP does not function on Solaris platforms because they do not support running jobs stored in /etc/cron.d.

Attributes

  • minute, hour, day, month, 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 @reboot, @yearly, @annually, @monthly, @weekly, @daily, @midnight or @hourly.
  • command - the command to run. Required.
  • user - the user to run as. Defaults to "root".
  • mailto, path, home, shell - set the corresponding environment variables in the cron.d file. No default.

Definitions

cron_control

The cron_control definition can be used to manage the /etc/cron.allow and /etc/cron.deny files.
Incude this cookbook as dependency to your cookbook and execute the definition as:

The following will add the user mike to the /etc/cron.allow file:

cron_manage 'mike' do
  user   'mike'
  action :allow
end

The following will add the user john to the /etc/cron.deny file:

cron_manage 'john' do
  user  'john'  #optional, resource name will be used if not specified.
  action :deny  #optional, deny is the default
end

Attributes

  • user - username that you want to control (optional).
  • action - :allow or :deny. :deny is the default.

License & Authors

Copyright 2010-2012, Opscode, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

cron's People

Contributors

bflad avatar dcrosta avatar flaccid avatar guilhem avatar jordane avatar koodough avatar meineerde avatar nathenharvey avatar sbotman avatar sethvargo avatar tas50 avatar tdg5 avatar tiaz avatar wfelipe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.