Time based Processing of the Scripts

Any one can tell me how can i execute the processes for every 10 min.Actually iam having 3 Processes for every 10 min i want to run these 3 Process,one process at every 10 min. If any of the process is busy i just want to execute the free one.

first 10 min
execute P1
next 10 min
execute P2
next 10 min
execute P3
next 10 min
execute P1 or P2 or P3 (Which ever is Free i.e if P1 Complete then it shoud trigger the P1 / if p2 is free the P2 should trigger/if P3 is free P3 Should trigger/else it shoul wait for the next free process.)

Please gurus help me on this.

I suggest you have a cron job which runs every 10 minutes and uses some mechanism to determine what processes are already running, eg using ps, pkill or files as flags.

When it has determined what is running, it can then kick of which ever job you think is appropriate.

thanks for replying...

can you send the code for the same.

  1. You'll find plenty of examples of people using cron jobs on this site.

  2. my answer to one of your other threads basically has the code for the temporary file approach