3 ms·
I make backups using cron, and recently I've been wondering what happens if the backup (hypothetically) takes longer than the interval between cron jobs. Will i
by amelius 9y ago
I make backups using cron, and recently I've been wondering what happens if the backup (hypothetically) takes longer than the interval between cron jobs. Will it start the new job while the old one is still running? Will unrelated cron jobs be blocked? And how is that in Mcron?
- gmjosack 9y agoYes. If you're worried about this you can take a look at `flock`. e.g. flock -xn /path/to/lock -c /path/to/command
- jamroom 9y agoYes - I believe it will start the new job while the old one is running - your backup script should write a PID file to ensure it isn't already running.
- pastage 9y agoSystemd solves this at least, but I do like cron better.