NAME

Yote::Cron

SYNOPSIS

Yote::Cron is a subsystem in Yote that functions like a cron, allowing scripts to be run inside Yote. Rather than use config files, this uses Yote objects to control the cron jobs. A cron editor is part of the Yote admin page.

DESCRIPTION

The Yote::Cron is set up on the yote system and runs every minute, checking if it should run any method that is attached to a yote object. It is a limited version of a cron system, as it for now only registers methods with minutes and hours.

The Yote::Cron's public methods can only be called by an account with the __is_root flag set.

PUBLIC METHODS

add_entry( $entry )

Ads an entry to this list. Takes a Yote::Obj that has the following data structure :

* name - name of script to run
* enabled - if true, this cron is active
* script - what to run
* repeats - a list of hashes with the following values : 
     * repeat_infinite - true if this will always be repeated
     * repeat_times - a number of times to repeat this; this decrements
     * repeat_interval - how many seconds to repeat this
* scheduled times - a list of epoc times this cron should be run
* next_time - epoc time this should be run next (volatile, should not be set by user)
* last_run - time this was last run (volatile, should not be set by user)
entries()

Returns a list of the entries that should be run at the time this was called.

mark_done( $entry )

Marks this entry as done. This causes any repeat_times to decrement, and removes appropriate scheduled times.

update_entry( $entry )

This recalculates the next time this entry will be run.

AUTHOR

Eric Wolf coyocanid@gmail.com http://madyote.com

LICENSE AND COPYRIGHT

Copyright (C) 2011 Eric Wolf

This module is free software; it can be used under the same terms as perl itself.