https://github.com/arirusso/crontest
For testing cron jobs
https://github.com/arirusso/crontest
Last synced: about 1 year ago
JSON representation
For testing cron jobs
- Host: GitHub
- URL: https://github.com/arirusso/crontest
- Owner: arirusso
- License: other
- Created: 2010-10-14T00:07:34.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2010-11-02T23:12:14.000Z (almost 16 years ago)
- Last Synced: 2025-07-04T00:02:22.725Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 117 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
#+COMMENT: -*- org -*-
#+TITLE: crontest
#+AUTHOR: Ari Russo
#+DATE: 2010-10-28 Wed
#+TEXT: ruby command line tool/library for testing cron jobs
#+KEYWORDS: cron, crontest, cron-test, crontab, linux, unix, test, tasks, jobs
#+LANGUAGE: en
#+LINK_HOME: http://github.com/arirusso/crontest
* Summary
Ruby libary and command line tool for testing cron jobs.
* Description
Execute an (almost) immediate and transient cron job using the same environment that is used to run your user's crontab.
* Requires
- [[http://github.com/soveran/clap][clap]]
* Usage
: gem install crontest
to run crontest from the command line:
: crontest 'echo hello! > MY_CRON_TEST.txt' &
or, to call from another ruby program
: require 'crontest'
: Crontest.run("echo hello! > MY_CRON_TEST.txt")
these will both run =echo hello! > MY_CRON_TEST.txt= as a cron job. it can take up to a minute to run as cron's timing resolution is one minute.
crontest will create a backup file of your current crontab (cron-backup-[timestamp]) in the directory where directory you run it, and then restore it.
Options:
pass in options from the command line or Crontest.run(command, options)
: --no-backup
: -n
: :backup => false
no backup file
: -v
: :verbose => true
verbose output
* Caution
I highly encourage you to keep a separate backup of your crontab before trying this tool as it is brand new and relatively untested.