similar to reinhard's script we use a perl script that checks first if
some srs updating routine already runs ...the script is called by cron every
hour - the problem is that cron jobs are "niced" and we want to give SRS
indexing a high priority ...btw Don, this also might also have slowed down
GenBank indexing...so the trick is to "rsh" the srsupdate command instead of
just calling it by "system" ...bit silly ...but works
first line says "perl5" but Perl4 should also work!
-------------------------------------------------------
#!/usr/pub/bin/perl5
#
# program: srsindex
# author: thure etzold
# date: February 2, 1994
#
# checks if some SRS indexing is already in progress and dies ...else
# checks and updates indices
#
# =====================================================================
# modify by : Antoine de Daruvar
# date: March 17, 1995
#
# - redirect STDOUT and STDERR to files
# - move the logfile to /data/update/trace_job
# - move the update file to /data/update/temp
# - control the size of the log file (run file_restriction)
#
# =====================================================================
$this_file = $0;
$this_file =~ s,.*/,,;
open(STDOUT,">/data/update/trace_job/$this_file.out");
open(STDERR,">/data/update/trace_job/$this_file.err");
$tmp = `ps -edalf`;
@proc = split ("\n", $tmp);
foreach (@proc) {
if (/srsbuild/ || /srscheck/ ) {
exit; # some indexing job is running already
}
}
$srsupd = "/data/update/temp/srsupd.csh";
$srslog = "/data/update/trace_job/srsupd.log";
$com = "source /opt/srs/etc/prep_srs >>& $srslog; " .
"srscheck -o $srsupd >>& $srslog;" .
"$srsupd >>& $srslog;date >>& $srslog";
# the rsh is to prevent default nicing for cron jobs
system ("rsh phenix \"csh -c \'$com'\"");
# avoid overgrowing of the log file (restrict it to 5000 lines)
system ("/data/manage/file_restriction $srslog H 5000");
exit;
-----------------------------
===============================================================================
Thure Etzold | EMBL
E-mail: etzold at embl-heidelberg.de | Postfach 10.2209
Tel: (49) 6221 387529 | 69012 Heidelberg
Fax: (49) 6221 387517 | Germany