Project

crontest

0.0
No commit activity in last 3 years
No release in over 3 years
ruby command line tool/library for testing cron jobs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 0
 Project Readme

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

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.