Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
= rsched
A Generic Reliable Scheduler. It's like cron, but rsched supports redundancy using multiple servers.
== Architecture
== Install
$ gem install rsched $ gem install dbd-mysql # to use MySQL as a lock database $ gem install dbd-sqlite3 # to use SQLite3 as a lock database
== Schedule
A schedule consists of ident, time and action. Ident describes unique identifier of the schedule that. Time describes when it should be scheduled. Action is an description of the schedule.
Format of the time is same as cron. See man 5 cron
for details.
Example:
$ rsched -a 'mysched * * * * * my descriptoin of this action' ...
$ rsched -a 'mywork 0 0 * * * aaaa uuu ee' ...
$ rsched -T mysql -H myhost -D mydb -u myuser -p mypassword ...
$ rsched -T sqlite3 -D /path/to/db.sqlite3 ...
== Usage
Usage: rsched [options] [-- ] --configure PATH.yaml Write configuration file --exec COMMAND Execute command --run SCRIPT.rb Run method named 'run' defined in the script -a, --add EXPR Add an execution schedule -t, --timeout SEC Retry timeout (default: 30) -r, --resume SEC Limit time to resume tasks (default: 3600) -E, --delete SEC Limit time to delete tasks (default: 2592000) -n, --name NAME Unique name of this node (default: PID.HOSTNAME) -w, --delay SEC Delay time before running a task (default: 0) -F, --from YYYY-mm-dd_OR_now Time to start scheduling -e, --extend-timeout SEC Threashold time before extending visibility timeout (default: timeout * 3/4) -x, --kill-timeout SEC Threashold time before killing process (default: timeout * 10) -X, --kill-retry SEC Threashold time before retrying killing process (default: 60) -i, --interval SEC Scheduling interval (default: 10) -U, --release-on-fail Releases lock if task failed so that other node can retry immediately -T, --type TYPE Lock database type (default: mysql) -D, --database DB Database name -H, --host HOST[:PORT] Database host -u, --user NAME Database user name -p, --password PASSWORD Database password --env K=V Set environment variable -d, --daemon PIDFILE Daemonize (default: foreground) -f, --file PATH.yaml Read configuration file
Lock database (-T) is used to synchronize scheduling status over multiple servers. Rsched supports following database types:
One of --exec, --run or --configure is required. The behavior of the commands is described below:
=== exec
Execute a command when an action is scheduled. ident, time and action is passed to the stdin with tab-separated format. The command have to exit with status code 0 when it succeeded.
Example:
#!/usr/bin/env ruby ident, time, action = STDIN.read.split("\t", 3) t = Time.at(time.to_i) puts "scheduled on #{t} ident=#{ident} action=#{action}"
=== run
This is same as 'exec' except that this calls a method named 'run' defined in the file instead of executing the file. It is assumed it succeeded if the method doesn't any raise errors.
Example:
def run(ident, time, action) t = Time.at(time) puts "scheduled on #{t} ident=#{ident} action=#{action}" end
FAQs
Unknown package
We found that rsched demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.