Solo

Solo is an interesting little Perl script:

solo is a very simple script (10 lines) that prevents a program from running more than one copy at a time. It is useful with cron to make sure that a job doesn’t run before a previous one has finished.

* * * * * solo -port=3801 /usr/local/bin/awesome-script.sh blah blah

The clever part is the use of binding to TCP ports to ensure that only one copy of the script is running at a time. No more lockfiles or filesystem tricks, just let the kernel figure out if the port is already in use.

Related posts:

  1. RSSCloud For WordPress
  2. Chrome, How Being Clever is Worse Than Being Simple

One thought on “Solo

  1. Pingback: PHP Workers with Redis & Solo | Justin Carmony

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>