Reputation: 179
We have a command in symfony that is being exceuted via a minutely CRON. The command is creating, writing records from the database to the CSV file and then downloading CSV file. I need to know if a command is executed once and the CSV process has started then on the next execution of the cron after a minute will the previous execution stop or will continue in the background ?
Upvotes: 0
Views: 665
Reputation: 6047
They will run in parallel as you would have started it from the console, so if that is undesirable, you would want to make sure that the previous process has finished or make the cron jobs run on bigger interval (or both).
You can use in cron * * * * * /usr/bin/pgrep "console" > /dev/null || bin/console ...
or something like that to check if there is an unfinished job already running
Upvotes: 1