[MKDoc-commit] [1.6] Randomise times that cronjobs run-at
bruno at mkdoc.demon.co.uk
bruno at mkdoc.demon.co.uk
Thu Dec 2 13:11:10 GMT 2004
Log Message:
-----------
[1.6] Randomise times that cronjobs run-at
Tags:
----
mkdoc-1-6
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.21.2.14
retrieving revision 1.21.2.15
diff -Ltools/install-details-gt.pl -Ltools/install-details-gt.pl -u -r1.21.2.14 -r1.21.2.15
--- 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;
"$prefix/$dir";
More information about the MKDoc-commit
mailing list