Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nguyenanh/crontab_rb
Easy and safe way to manage your crontab file via CRUD
https://github.com/nguyenanh/crontab_rb
cron-jobs cronjob crontab crontab-rb crud ruby rubyonrails unix
Last synced: 3 days ago
JSON representation
Easy and safe way to manage your crontab file via CRUD
- Host: GitHub
- URL: https://github.com/nguyenanh/crontab_rb
- Owner: Nguyenanh
- License: mit
- Created: 2019-08-06T04:50:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-05T02:59:56.000Z (over 2 years ago)
- Last Synced: 2025-01-14T11:55:54.547Z (9 days ago)
- Topics: cron-jobs, cronjob, crontab, crontab-rb, crud, ruby, rubyonrails, unix
- Language: Ruby
- Homepage:
- Size: 29.3 KB
- Stars: 4
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Crontab RB
[![Gem Version](https://badge.fury.io/rb/crontab_rb.svg)](https://badge.fury.io/rb/crontab_rb)
crontab_rb is a Ruby gem that provides easy and safe way to manage your cron jobs unix file via CRUD.
### Installation
```sh
$ gem install crontab_rb
```Or with Bundler in your Gemfile.
```ruby
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.
```ruby
# */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
```ruby
CrontabRb::Cron.destroy("64f4f0bc-ad80-48ef-bbb9-98c9c17624bd")
```Get list cron jobs
```ruby
CrontabRb::Cron.all
```Update a cron job
```ruby
# 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](LICENSE.md)