[MKDoc-commit] Randomise times that cronjobs run-at
bruno at mkdoc.demon.co.uk
bruno at mkdoc.demon.co.uk
Thu Dec 2 13:00:05 GMT 2004
Log Message:
-----------
Randomise times that cronjobs run-at
Modified Files:
--------------
mkd/tools:
install-details-gt.pl
-------------- next part --------------
Index: install-details-gt.pl
===================================================================
RCS file: /var/spool/cvs/mkd/tools/install-details-gt.pl,v
retrieving revision 1.36
retrieving revision 1.37
diff -Ltools/install-details-gt.pl -Ltools/install-details-gt.pl -u -r1.36 -r1.37
--- tools/install-details-gt.pl
+++ tools/install-details-gt.pl
@@ -456,9 +456,12 @@
# need to populate the crontab with search indexer and rss fetcher
require GPanel::Crontab;
my $c = GPanel::Crontab->new(user => $user_name);
- $c->add_raw->value("0 * * * * source $MKDOC_DIR/mksetenv.sh && 010..indexer.pl 5400 >/dev/null");
- $c->add_raw->value("0,20,40 * * * * source $MKDOC_DIR/mksetenv.sh && 030..rss_troubleshooter.pl 36 >/dev/null");
- $c->add_raw->value("0 11 * * * source $MKDOC_DIR/mksetenv.sh && 031..rss_routine.pl");
+ my $rand_60 = int (rand (60));
+ my $rand_20 = int (rand (20));
+ my $rand_abc = join ",", (0 + $rand_20), (20 + $rand_20), (40 + $rand_20);
+ $c->add_raw->value("$rand_60 * * * * source $MKDOC_DIR/mksetenv.sh && 010..indexer.pl 5400 >/dev/null");
+ $c->add_raw->value("$rand_abc * * * * source $MKDOC_DIR/mksetenv.sh && 030..rss_troubleshooter.pl 36 >/dev/null");
+ $c->add_raw->value("$rand_60 11 * * * source $MKDOC_DIR/mksetenv.sh && 031..rss_routine.pl");
$c->write;
}
More information about the MKDoc-commit
mailing list