daily cron runs overlap
jnorell opened this issue · 1 comments
The scan from the daily cron job should use a lock file so only one instance runs at a time.
We have one web server with enough files being scanned by the daily cron run that it sometimes doesn't complete within 24 hours, and the next day's cron job kicks off and starts another overlapping scan job - from there, things just go downhill, as the surely won't complete in a day, etc. ... after a while it'll be sluggish and I'll find 4 or 5 simulatneous scans running.
As the daily maldet scan runs in the background (-b), the cronjob as a whole can't just use a lock file, but I did test running the maldet scan without -b in a subshell, and have the subshell check/create/remove the lockfile, which worked. There may be more elegant solutions.