I'm working on setting up an RTI license server to auto start on bootup. I've got that working, but it writes a new boot.log file every time overwriting the old one as it does. I'd like to have it create a new log file each time so that I can have some history when troubleshooting.
I've tried implementing a shell variable to create a logfile with the date in it, but am not having any luck getting it to work.
I want the boot.log file to be replaced with a file with a name like: log-Aug-12-08.
Thanks for the help: See file with my trials at the top, but functioning normally below.
Here is what I've got:
#!/bin/sh
#!/bin/csh
#
/bin/su rtiserver -c set tds = `date +"%b-%d-%y"`
echo $tds
/bin/su rtiserver -c set logfile = "log-$tds.log"
echo $logfile
/bin/su rtiserver -c 'echo starting lmgrd > \
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/boot.log'
/usr/bin/nohup /bin/su rtiserver -c 'umask 022; \
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/lmgrd -c \
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/server.lic >> \
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/boot.log'
/bin/su rtiserver -c 'echo sleep 5 >> \
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/boot.log'
/bin/sleep 5
/bin/su rtiserver -c 'echo lmdiag >>\
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/boot.log'
/bin/su rtiserver -c '/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3lmdiag -n -c\
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/server.lic >> \
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/boot.log'
/bin/su rtiserver -c 'echo exiting >>\
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/boot.log'
touch /var/lock/subsys/local
I've tried implementing a shell variable to create a logfile with the date in it, but am not having any luck getting it to work.
I want the boot.log file to be replaced with a file with a name like: log-Aug-12-08.
Thanks for the help: See file with my trials at the top, but functioning normally below.
Here is what I've got:
#!/bin/sh
#!/bin/csh
#
/bin/su rtiserver -c set tds = `date +"%b-%d-%y"`
echo $tds
/bin/su rtiserver -c set logfile = "log-$tds.log"
echo $logfile
/bin/su rtiserver -c 'echo starting lmgrd > \
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/boot.log'
/usr/bin/nohup /bin/su rtiserver -c 'umask 022; \
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/lmgrd -c \
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/server.lic >> \
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/boot.log'
/bin/su rtiserver -c 'echo sleep 5 >> \
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/boot.log'
/bin/sleep 5
/bin/su rtiserver -c 'echo lmdiag >>\
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/boot.log'
/bin/su rtiserver -c '/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3lmdiag -n -c\
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/server.lic >> \
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/boot.log'
/bin/su rtiserver -c 'echo exiting >>\
/home/rtiserver/FLEXlm-Linux-rhe4.0-i386-gcc-3.4.3/boot.log'
touch /var/lock/subsys/local