I had a task that I have to write up a simple bash script which in turn executes admin command from Websphere Application Server (WAS). I put it into /etc/cron.daily folder hoping it would be executed in a daily basis (at what time I have no idea). However I want to have a footprint of this script is kicked off by the system so I added echo statement.
#!/bin/bash [foo command to execute] echo "foo command is executed" > /bpm/v8/logs/foo.log
Now I have three questions.
- There is system log file from WAS (SystemOut.log). Is it possible to write output of echo to SystemOut.log file?
- If not, is there a way that I could append date/time stamp to foo.log file?
- How can I prevent foo.log file eating up disk space? I know that SystemOut.log file gets compressed saved with date/time stamp time to time. I think some sort of log rotate(?) program does it.
Context of this problem is in rhel v6 64-bit machine.