[Lxc-users] Cron jobs in containers..

Whit Blauvelt whit at transpect.com
Thu Jul 8 18:05:08 UTC 2010


On Thu, Jul 08, 2010 at 06:46:20PM +0100, Gordon Henderson wrote:
> 
> Sort of thinking out loud, but looking for suggestions/ideas ...
> 
> So I have a host with 20 containers and each of these 'servers' runs cron 
> jobs - and one of them is to do an MRTG run every 5 minutes, so every 5 
> minutes, ka-chung, 20 jobs start at the same time which sort of has a bit 
> of a crowbarring effect...

You could fudge it. For instance, I have two cron jobs that I want to run on
alternate minutes. I give these as (in an /etc/cron.d file, thus the
userid):

*/2 * * * * userid do_the_first_thing
*/2 * * * * userid sleep 60;do_the_second_thing

There may well be an elegant way to do it, which this is not, but it does
work to stagger jobs.

Whit




More information about the lxc-users mailing list