If I manually call up the following script it runs fine:
DAYRUN=`date +%Y%m%d`
TIMERUN=`date +%H%M`
print $DAYRUN$TIMERUN > DAYRUN
who > wholog
cat wholog >> DAYRUN
cat DAYRUN >> /export/home/cms/logs/wholog$DAYRUN.txt
It creates a file wholog20071127.txt (if I run it today) with the first line being the date and time run, then a list of who is curently logged into the system. If I run it again, say 5 minutes later, it will append to the end of the file and will have a line showing the date and time (5 min later) and a list of who is logged in.
If I run this using crontab, it doesn't put the date and time stamp at the begining of the new list, it just appends the current who log to the end of the file.
Here is the crontab file:
0,30 * * * * /export/home/cms/loggedin.sh
Any ideas?
- Stinney
Favorite all too common vendor responses: "We've never seen this issue before." AND "No one's ever wanted to use it like that before.