OpsScript

Module to provide basic functionality common to many operations scripts. Specifically:

  • Create and manage log file
  • Use PID file to insure only one instance runs at a time
  • Provide basic command line options such as --debug to log debug messages

Installation

Add this line to your application's Gemfile:

gem 'ops_script'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ops_script

Usage

require 'ops_script'
include OpsScript

# Add custom options
option_parser.on "--bar", "The bar option" do
  options[:bar] = true
end

# Run your code
OpsScript.run do
    log.info "This is my script running!"
    # your code here
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request