Originally Posted by cpthk
I am setting up linux cron job. I was wondering if I set the cron job to wake up every minute. My process may take several minutes. Will there be a duplicate process issue?
For example, I am running a.out program. This program in busy load may take 5 minutes to finish. I need to set my corn job to run every minute. Will the linux cron run before the previous one finishes? Or it will wait for the previous one to finish? Or it will not run at all if the previous is still running?
I really need to set the cron as every minute for particular reason. Even I set it for a longer time, the program could still run longer than that depends on the load.
No, it will spawn another job, and you'll have several all running at the same time.
And setting up a process that you know will take longer than a minute to complete, to run every minute, seems like a bad idea. Why don't you put a sleep statement into your script, so it'll pause for one minute, after each run? Then just run it with "nohup <script name> >/dev/null &", and it'll background and run just fine.