ADSM-L

Re: [ADSM-L] catching the current tsm sched and error logs

2015-04-10 14:52:02
Subject: Re: [ADSM-L] catching the current tsm sched and error logs
From: Erwann SIMON <erwann.simon AT FREE DOT FR>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Fri, 10 Apr 2015 20:50:17 +0200
Hi Gary,

You should not remove (rm) log files that are currently open. Doing this, 
you're only unlinking them from the directory but not deleting the inode that 
remains open until you stop the scheduler.

Try to replace those line :
rm -f $LOGDIR$SCHEDLOG
rm -f $LOGDIR$ERRLOG
touch $LOGDIR$SCHEDLOG
touch $LOGDIR$ERRLOG
By :
> $LOGDIR$SCHEDLOG
> $LOGDIR$ERRLOG

You should also test that your variables are correctly defined, it's advisable 
when pruning files from a script in order to avoid mistakes...

-- 
Best regards / Cordialement / مع تحياتي
Erwann SIMON

----- Mail original -----
De: "Gary Lee" <glee AT BSU DOT EDU>
À: ADSM-L AT VM.MARIST DOT EDU
Envoyé: Vendredi 10 Avril 2015 19:12:37
Objet: [ADSM-L] catching the current tsm sched and error logs

Trying to work out a way to capture dsmsched.log and dsmerror.log for only the 
most recent scheduled activity.

Tried using a postschedulecmd to submit a job to at but it does not capture the 
activity.
The captured log starts with the messages about log pruning.  As if the client 
had not written the log.

Script sent to at follows:


#!/bin/sh

# email error log to designated addressee, append logs to histories,
# then remove

# author gary lee
# date created 04/10/2015

#customizations necessary
# change the two log names to suit your machine.
# change subject text to suit.
# change $RECIP appropriately
# format string in the date command may need to be altered based on
# the date format in your schedule and error logs.
#
# this scripts full path name is the argument to postschedulecmd in dsm.sys

# variables

DATE=$(date '+%m/%d/%Y')
HOST=$(hostname -s)
RECIP=glee AT bsu DOT edu
LOGDIR=/opt/tivoli/tsm/client/log/
ERRLOG=dsmerror.log
ERRLOGHISTORY=dsmerror.log.hist
SCHEDLOG=dsmsched.log
SCHEDLOGHISTORY=dsmsched.log.hist

cat $LOGDIR$SCHEDLOG >> $LOGDIR$SCHEDLOGHISTORY
cat $LOGDIR$ERRLOG >> $LOGDIR$ERRLOGHISTORY

mailx -s " DSMerror.log from $HOST $DATE " $RECIP <$LOGDIR$ERRLOG
mailx -s " DSMsched.log from $HOST $DATE " $RECIP <$LOGDIR$SCHEDLOG
rm -f $LOGDIR$SCHEDLOG
rm -f $LOGDIR$ERRLOG
touch $LOGDIR$SCHEDLOG
touch $LOGDIR$ERRLOG

any help appreciated.

<Prev in Thread] Current Thread [Next in Thread>