Andrew Beaton :: FAQ

Tag: schedule

Run a cron job every x seconds

by Andrew on Jan.26, 2010, under Linux

As most of you know, the smallest time a cron job can be configured to run is every minute.
To run a script every 15 seconds for example, you could use the following:

main cron job:

* * * * * /path/to/wrapper.sh

wrapper.sh:

/path/to/script &
sleep 15
/path/to/script &
sleep 15
/path/to/script &
sleep 15
/path/to/script &

If you can suggest any nicer alternatives to this example, please let me know. :)

Leave a Comment :, , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

 

Archives

All entries, chronologically...