-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
041d3dc
commit eac1d90
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
SHELL=/bin/sh | ||
top_srcdir=@top_srcdir@ | ||
RM=$(top_srcdir)/devscripts/rm_if | ||
prefix=@prefix@ | ||
exec_prefix=@exec_prefix@ | ||
INSTALL=@top_srcdir@/conf/install-sh -c | ||
|
||
SCRIPTS = \ | ||
@MAKEBINDIR@unix_submit \ | ||
@MAKEBINDIR@synchronize_unix | ||
|
||
all : @MAKEBINDIR@ \ | ||
$(SCRIPTS) | ||
|
||
clean : | ||
@ $(RM) $(SCRIPTS) | ||
|
||
install: | ||
for script in $(SCRIPTS) ; do\ | ||
$(INSTALL) -m 755 $${script} @bindir@;\ | ||
done | ||
|
||
@MAKEBINDIR@unix_submit : unix_submit | ||
cp unix_submit @MAKEBINDIR@unix_submit | ||
|
||
@MAKEBINDIR@synchronize_unix : synchronize_unix | ||
cp synchronize_unix @MAKEBINDIR@sychronize_unix | ||
|
||
@MAKEBINDIR@ : | ||
mkdir @MAKEBINDIR@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
if [ "x$MDS_LOGS" = "x" ]; then | ||
MDS_LOGS="/var/log/mdsplus"; | ||
fi | ||
if [ -d $MDS_LOGS -a -w $MDS_LOGS ]; then | ||
FILE=`basename $1 ".sh"` | ||
LOCKFILE="$MDS_LOGS/$FILE.$2.log.lock" | ||
lockfile -1 $LOCKFILE | ||
rm -f $LOCKFILE | ||
else | ||
echo "Directory MDS_LOGS ($MDS_LOGS) must exist and be writeable" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
# | ||
# file: /usr/local/mdsplus/bin/unix_submit.sh | ||
# | ||
# shell script to spawn a batch job for automatic intershot analysis. | ||
# | ||
# called by unix_submit.fun | ||
# | ||
# procedure: | ||
# build a log file name from the base file name | ||
# (logs go to /var/mdsplus/log) | ||
# insert a status line for this shot | ||
# invoke the job with the shot number as $1 redirecting stdout and err | ||
# to the end of the log file | ||
# insert a done status line for this shot | ||
|
||
FILE=`basename $1 ".sh"` | ||
if [ "x$MDS_LOGS" = "x" ]; then | ||
MDS_LOGS="/var/log/mdsplus"; | ||
fi | ||
if [ -d "$MDS_LOGS" -a -w "$MDS_LOGS" ]; then | ||
LOG="$MDS_LOGS/$FILE.$2.log" | ||
CUMULATIVE_LOG="$MDS_LOGS/$FILE.log" | ||
lockfile "$LOG.lock" | ||
echo ">>>>>>>>>>>>>>>>>>>>> $2 >>>>>>>>>>>>>>>>>>>>" >> $LOG | ||
date >> $LOG | ||
/usr/bin/time -a -f "Elapsed %E\tUser %U\tSystem %S" -o $LOG $1 $2 >>$LOG 2>&1 | ||
echo "<<<<<<<<<<<<<<<<<<<<< $2 <<<<<<<<<<<<<<<<<<<<" >> $LOG | ||
echo " " > $LOG | ||
cat $LOG >> $CUMULATIVE_LOG | ||
rm -f $LOG | ||
rm -f "$LOG.lock" | ||
else | ||
echo "Directory MDS_LOGS ($MDS_LOGS) must exist and be writeable" | ||
fi |