I have a script I’d like to run every minute, but the process takes a few minutes to finish, so I’d like the script to beginning running again as a new process while the other process continues. In crontab, I have:
* * * * * bash /dir/program.sh
Over the course of three minutes, I would expect this script to start three times.
It’s hard for me to determine looking at
htop whether it’s starting the process once each minute even if it’s already running, as
htop sometimes shows the same script running multiple times even if it’s not. I’ve used
pgref -f "process name" and it shows a single process number, but I’m not sure if pgrep can show multiple numbers or not.
Does cron start the job up again each time or does it wait for the first cronjob to finish?