
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Cron is non-ideal for running scheduled application tasks, especially in an app deployed to multiple machines. More details.
Clockworkd is a cron replacement. It runs as a lightweight, long-running Ruby process which sits alongside your web processes (Mongrel/Thin) and your worker processes (DJ/Resque/Minion/Stalker) to schedule recurring work at particular times or dates. For example, refreshing feeds on an hourly basis, or send reminder emails on a nightly basis, or generating invoices once a month on the 1st.
Configure application:
In your Gemfile gem "clockworkd", ">= 0.2.5" Run generator to generate config yml and script file Use config/initiaizers to configure options for this gem
Modify clockworkd.yml:
# Run job every two minute: */2 * * * *
clear_sesssion_job:
cron: "59 1 * * *"
block: Delayed::Job.enqueue ClearSessionsJob.new
description: "This job clear sessions table"
Run it as console or daemon application (rails 3.x):
$ ruby script/clockworkd run
$ ruby script/clockworkd --identifier=0 start
Use clockworkd with capistrano:
after "deploy:stop", "clockworkd:stop"
after "deploy:start", "clockworkd:start"
after "deploy:restart", "clockworkd:restart"
Use monit script to monitor it:
check process clockworkd
with pidfile /var/www/apps/{app_name}/shared/pids/clockworkd.pid
start program = "/usr/bin/env RAILS_ENV=production /var/www/apps/{app_name}/current/script/clockworkd start"
stop program = "/usr/bin/env RAILS_ENV=production /var/www/apps/{app_name}/current/script/clockworkd stop"
Only one clock process should ever be running across your whole application deployment. For example, if your app is running on three VPS machines (two app servers and one database), your app machines might have the following process topography:
You should use Monit, God, Upstart, or Inittab to keep your clock process running the same way you keep your web and workers running.
Inspired by
Example goes here.
Copyright (c) 2011 arufanov, released under the MIT license.
FAQs
Unknown package
We found that clockworkd 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
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.