Project

crontab_rb

0.01
No release in over 3 years
Low commit activity in last 3 years
Easy and safe way to manage your crontab file via CRUD
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.12.2
~> 10.0

Runtime

 Project Readme

Crontab RB

Gem Version

crontab_rb is a Ruby gem that provides easy and safe way to manage your cron jobs unix file via CRUD.

Installation

$ gem install crontab_rb

Or with Bundler in your Gemfile.

gem 'crontab_rb'

Run bundle install to install the backend and crontab_rb gems.

Getting started

Add new a cron job at every 10th minute.

# */10 * * * * /bin/bash -l -c 'cd path_to_rails_app && bundle exec rake backup_db'

CrontabRb::Cron.create(name: 'Backup database', time: '1', at: '10', command: 'rake backup_db')

Delete a cron job

CrontabRb::Cron.destroy("64f4f0bc-ad80-48ef-bbb9-98c9c17624bd")

Get list cron jobs

CrontabRb::Cron.all

Update a cron job

# 30 * * * * /bin/bash -l -c 'cd path_to_rails_app && bundle exec rake remove_log'

CrontabRb::Cron.destroy("64f4f0bc-ad80-48ef-bbb9-98c9c17624bd", {name: 'Remove log file', time: '60', at: '30', command: 'rake remove_log'})

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Nguyenanh/crontab_rb.

Contribute

Fork Crontab RB and contribute to it. Pull requests are encouraged.

License

MIT