From: Faiyaz Ahmed Date: Thu, 18 Oct 2007 18:07:06 +0000 (+0000) Subject: Update twice a day. X-Git-Url: http://git.onelab.eu/?p=nodeupdate.git;a=commitdiff_plain;h=d427d25ffb924eb775c4ef1aa15d99fc392261b3 Update twice a day. --- diff --git a/NodeUpdate.py b/NodeUpdate.py index 28e635a..b0cd6d8 100644 --- a/NodeUpdate.py +++ b/NodeUpdate.py @@ -60,14 +60,14 @@ def UpdateCronFile(): try: randomMinute= Random().randrange( 0, 59, 1 ); - randomHour= Random().randrange( 0, 23, 1 ); + randomHour= Random().randrange( 0, 11, 1 ); f = open( CRON_FILE, 'w' ); f.write( "# %s\n" % (TARGET_DESC) ); f.write( "MAILTO=%s\n" % (TARGET_USER) ); f.write( "SHELL=%s\n" % (TARGET_SHELL) ); - f.write( "%s %s * * * %s %s\n\n" % - (randomMinute, randomHour, TARGET_USER, TARGET_SCRIPT) ); + f.write( "%s %s,%s * * * %s %s\n\n" % + (randomMinute, randomHour, randomHour + 12, TARGET_USER, TARGET_SCRIPT) ); f.close() print( "Created new cron.d entry." )