Commit 87fef2c3 authored by Mac Newbold's avatar Mac Newbold
Browse files

Add the proper crontab line in comments in the source and to boss-install.

parent 67b84dc2
......@@ -6,7 +6,16 @@
# All rights reserved.
#
#
# idlemail - send mail to idle expts
#
# see usage message below for details
#
# This should get run out of cron, about every 5 minutes or so.
# Add an entry like this to /etc/crontab:
#
# */5 * * * * root /usr/testbed/sbin/idlemail
#
# Configure variables
use lib '@prefix@/lib';
......@@ -15,30 +24,6 @@ use libtestbed;
use English;
use Getopt::Std;
my $THISHOMEBASE = "@THISHOMEBASE@";
my $TBBASE = "@TBBASE@";
my $TBDOCBASE = "@TBDOCBASE@";
my $TBMAILADDR_OPS = "@TBOPSEMAIL@";
my $TBMAILADDR_WWW = "@TBWWWEMAIL@";
my $TBMAILADDR_AUDIT = "@TBAUDITEMAIL@";
my $TBMAIL_OPS = "Testbed Ops <$TBMAILADDR_OPS>";
my $TBMAIL_WWW = "Testbed WWW <$TBMAILADDR_WWW>";
my $TBMAIL_AUDIT = "Testbed Audit <$TBMAILADDR_AUDIT>";
my $TBMAIL_AUTOMAIL = "@TBAUTOMAILEMAIL@";
# Turn off line buffering on output
$| = 1;
# Defaults
# Don't put 'my' on these, or they won't be settable with ${$var}
$h = 0; # help mode
$d = 0; # debug mode
$n = 0; # no-mail mode
$f = 0; # force mode
print "Got ARGV = ",join(" ",@ARGV),"\n" if $d;
# Grab our site variables...
my $mailinterval = TBGetSiteVar("idle/mailinterval");
my $threshold = TBGetSiteVar("idle/threshold");
......@@ -66,6 +51,30 @@ mail interval = $mailinterval hours
Start CC'ing group leaders on message $cc_grp_ldrs\n");
}
my $THISHOMEBASE = "@THISHOMEBASE@";
my $TBBASE = "@TBBASE@";
my $TBDOCBASE = "@TBDOCBASE@";
my $TBMAILADDR_OPS = "@TBOPSEMAIL@";
my $TBMAILADDR_WWW = "@TBWWWEMAIL@";
my $TBMAILADDR_AUDIT = "@TBAUDITEMAIL@";
my $TBMAIL_OPS = "Testbed Ops <$TBMAILADDR_OPS>";
my $TBMAIL_WWW = "Testbed WWW <$TBMAILADDR_WWW>";
my $TBMAIL_AUDIT = "Testbed Audit <$TBMAILADDR_AUDIT>";
my $TBMAIL_AUTOMAIL = "@TBAUTOMAILEMAIL@";
# Turn off line buffering on output
$| = 1;
# Defaults
# Don't put 'my' on these, or they won't be settable with ${$var}
$h = 0; # help mode
$d = 0; # debug mode
$n = 0; # no-mail mode
$f = 0; # force mode
print "Got ARGV = ",join(" ",@ARGV),"\n" if $d;
my $optlist = "hdnf";
my %opt = ();
if (! getopts($optlist,\%opt)) { help(); }
......
......@@ -435,8 +435,9 @@ Phase "cron", "Adding cron jobs", sub {
Phase "crontab", "Editing $CRONTAB", sub {
DoneIfEdited($CRONTAB);
AppendToFileFatal($CRONTAB,
"45 \t1\t*\t*\t*\troot\t/usr/testbed/sbin/backup",
"*/5\t*\t*\t*\t*\troot\t/usr/testbed/sbin/node_status");
"45 \t1\t*\t*\t*\troot\t$PREFIX/sbin/backup",
"*/5\t*\t*\t*\t*\troot\t$PREFIX/sbin/node_status",
"*/5\t*\t*\t*\t*\troot\t$PREFIX/sbin/idlemail");
};
Phase "cronhup", "HUPing cron", sub {
if (PhaseWasSkipped("crontab")) { PhaseSkip("No new crontab"); }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment