ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/confsums.pl
Revision: 1.2
Committed: Thu Apr 23 16:53:08 2009 UTC (14 years, 5 months ago) by arta
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
State: FILE REMOVED
Log Message:
remove confsums.pl as Rick now uses a different file

File Contents

# Content
1 #!/usr/bin/perl -w
2
3 use Cwd;
4
5 my($sumslogdir);
6 my($sumsmanager);
7 my($script);
8
9 if (!(-e "suflag.txt") && !(-e "config.local"))
10 {
11 # Use config.local.template
12 system("./configure");
13 }
14
15 # Get the variables from config.local that are needed
16 if (-e "config.local")
17 {
18 my($line);
19
20 open(CONFIGLOC, "<config.local");
21 while (defined($line = <CONFIGLOC>))
22 {
23 chomp($line);
24 if ($line =~ /SUMS_LOG_BASEDIR\s+(.+)/)
25 {
26 $sumslogdir = $1;
27 }
28 elsif ($line =~ /SUMS_MANAGER\s+(.+)/)
29 {
30 $sumsmanager = $1;
31 }
32 }
33 close(CONFIGLOC);
34
35 if (defined($sumslogdir))
36 {
37 $script = "$sumslogdir/sum_rm.cfg";
38 print STDOUT "*** generating template $script ***\n";
39
40 open(SUMSRMCFG, ">$script") || die "this script $script must be run by someone with write access\n to the directory $sumslogdir (which must also exist),\n e.g. $sumsmanager, if you will be running SUMS on this server";
41
42 print SUMSRMCFG "# configuration file for sum_rm program\n#\n";
43 print SUMSRMCFG "# when done, sleep for n seconds before re-running\n";
44 print SUMSRMCFG "SLEEP=900\n";
45 print SUMSRMCFG "# delete until this many Mb free on SUMS partitions\n";
46 print SUMSRMCFG "MAX_FREE_0=100000\n";
47 print SUMSRMCFG "# log file (only opened at startup and pid gets appended to this name)\n";
48 print SUMSRMCFG "LOG=$sumslogdir/sum_rm.log\n";
49 print SUMSRMCFG "# whom to bother when there's a notable problem\n";
50 print SUMSRMCFG "MAIL=$sumsmanager\n";
51 print SUMSRMCFG "# to prevent sum_rm from doing anything set non-0\n";
52 print SUMSRMCFG "NOOP=0\n";
53 print SUMSRMCFG "# sum_rm can only be enabled for a single user\n";
54 print SUMSRMCFG "USER=$sumsmanager\n";
55 print SUMSRMCFG "# dont run sum_rm between these NORUN hours of the day (0-23)\n";
56 print SUMSRMCFG "# comment out to ignore or set them both to the same hour\n";
57 print SUMSRMCFG "# The NORUN_STOP must be >= NORUN_START\n";
58 print SUMSRMCFG "# dont run when the hour first hits NORUN_START\n";
59 print SUMSRMCFG "NORUN_START=7\n";
60 print SUMSRMCFG "# start running again when the hour first hits NORUN_STOP\n";
61 print SUMSRMCFG "NORUN_STOP=7\n";
62
63 close(SUMSRMCFG);
64
65 print STDOUT "\nBe sure to review file $script\n";
66 print STDOUT " and make appropriate modifications if you will be running SUMS\n"
67 }
68 }