I just created test cron job which executes every minute:
#!/bin/bash
echo "123" >> /home/user/test-file
sleep 100
echo "234" >> /home/user/test-file
So I did see overlap in htop
. I mean there was periods of time when I saw two processes running simultaneously. 123
was echoed at the begging of the minute and 234
was echoed at 40 seconds of next minute (because of sleep 100
). In period of 40 seconds to beginning of next minute there was just one process.
That means cron fires jobs and does not wait for them to finish.
I'll try to represent it graphically:
0 minute 00 seconds 123 <----first execution
1 minute 00 seconds 123 <----second execution
1 minute 40 seconds 234 <----first execution
2 minute 00 seconds 123 <----third execution
2 minute 40 seconds 234 <----second execution
3 minute 00 seconds 123 <----fourth execution
3 minute 40 seconds 234 <----third execution
At least this is true for jobs in the /etc/crontab
with vixie-cron
on fresh updated Gentoo.
As Paul discovered - stuff in cron.daily
executes in the different way.