I have a script that, every night, chooses a network from a supplied list, and runs a series of scripts against it. The purpose of the script is supposed to be slow vulnerability assesment as well at network mapping and inventory control. The problem is, scanning one network per night is TOO slow.
The script is set up so that every time it is run, it selects a new network from the list. What we'd like to do is run it multiple times per night, but more efficently than at fixed intervals, so that if one network that gets scanned and has nothing on it only takes 15 minutes, then next network, which may take hours, fires off right away.
I have thought to make a wrapper that checks for running processes every x minutes and fires the script if nothing is found, but I was wondering if there was a better way to do it with cron or at.
Any suggestions? Only one instance can be run at a time, and we want to start as many as prudent between certain hours, especially when we get into long groups of mostly-empty networks.