Yesterday I had the need to run a cron process more than once a minute -- I wanted to grab a still frame from a web camera every 15 seconds, in order to create a time-lapse movie. The standard cron syntax lets you specify the minute(s) at which a task runs, but you cannot (to my knowledge) specify an interval less than once a minute (using */1).
After much Googling, I finally found the solution, posted in some newsgroup somewhere (sorry, I didn't mark the page): create a simple shell script that repeatedly runs the task, with a sleep command between each call to the job. In my case, my shell script looked like this:
#!/bin/sh
open /path/to/getpic.app
sleep 15
open /path/to/getpic.app
sleep 15
open /path/to/getpic.app
sleep 15
open /path/to/getpic.app
sleep 15
This will run the task four times over the course of a minute (not allowing for processing time). I then created my cron entry to call the above script, with the minute interval set to "every minute" (*/1), and sat back to see what would happen (not for the full twelve hours, of course!). The final result? Not too bad, but not perfect -- I captured a frame about every 25 seconds, instead of every 15. I think I need to reduce the sleep value to allow for the processing time of the getpic.app, so I'll try that later today. As for exactly what it was I was capturing for 12 hours, well, that too is for another day. (It will probably show up on my blog, not here -- though I may write up the 'acquire image' bit as a separate hint, as it was a little tricky.)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20070516060214429