Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A dsl for cron
Ruby
Branch: master
Pull request Compare This branch is 5 commits behind scrooloose:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
README

README

This is a dsl for making crontab code that ive been hacking for fun. Ill probably
make it into a gem at some stage.

Below is an example ruby file that uses crondle.


    require 'lib/crondle'

    Crondle.define_jobs do |builder|

      builder.desc "Restart god every midnight"
      builder.job "/home/admin/bin/god-restart", :minute => 0,
                                                 :hour => 0

      builder.desc "Do an ls at 00:30 on the 5th day of every month"
      builder.job "ls", :minute => 30,
                        :hour => 0,
                        :day_of_month => 5

      builder.desc "Do a foobar every tuesday at midnight"
      builder.job "foobar", :day_of_week => :tuesday,
                        :hour => 0,
                        :minute => 0

      builder.desc "Run rodney at midnight nightly"
      builder.daily_job "rodney"

      builder.desc "Run boner at 3am nightly"
      builder.daily_job "boner", 3
    end


Running ruby on this file would produce the following crontab code


    # Restart god every midnight
    0 0 * * * /home/admin/bin/god-restart

    # Do an ls at 00:30 on the 5th day of every month
    30 0 5 * * ls

    # Do a foobar every tuesday at midnight
    0 0 * * 2 foobar

    # Run rodney at midnight nightly
    0 0 * * * rodney

    # Run boner at 3am nightly
    0 3 * * * boner

Something went wrong with that request. Please try again.