crontab to run every 20 second

Hi experts,

I want to set the crontab for my script which will run every 20 seconds

I think below could be the possible one-

*/3 * * * * /export/home/username/scripts/runing.sh

As my system(SOLARIS 9) is live- i am confused to implement before make sure !!!

I need your suggestion.

//purple

No, it won't, instead it will run every 3 minutes (* == At any minute, /3 == every 3, */3 every 3 minutes, no matter what minute). AFAIK it's not possible to create a crontab entry for anything less than every minute.
If you really need to run something every 20 seconds, rather write a script that backgrounds and starts the desired action in a loop (using sleep or something alike).

HTH

So, its not possible to run every 20 second in SunSolaris. Well I now plan to to define it every 1 minute.

        • /export/home/username/script/running.sh

Above is okay for 1 minute interval right??

Yes, that would run your script every minute. But I would still advise that any activity that has to run in such short intervals should rather be implemented as some kind of daemon (or daemon-like script), rather than be invoked by cron.

Hi Pludi,

Many thanks for your advise. I am interested to take your suggestion to run my script using any daemon-like script.

As you said- write a script that backgrounds and starts the desired action in a loop.

Could you please help me on this to write the script??