Hi All,
Good Day.
Anyone can guide me on how to create a cronjob script that run prstat -a and vmstat 10 10 on the certain time of the day and produce a log which will be kept in a specific directory?
I am running on Solaris 10.
Thanks.
Hi All,
Good Day.
Anyone can guide me on how to create a cronjob script that run prstat -a and vmstat 10 10 on the certain time of the day and produce a log which will be kept in a specific directory?
I am running on Solaris 10.
Thanks.
Hei Ronny,
The cron job should look like this:
0 8 * * * /export/home/urname/script/logfile.sh > /dev/null 2>&1
And the logfile.sh looks like this:
#!/bin/bash
YEAR=`TZ=Europe/London /usr/bin/date '+%Y'`
MONTH=`TZ=Europe/London /usr/bin/date '+%m'`
DAY=`TZ=Europe/London /usr/bin/date '+%d'`
HOUR=`TZ=Europe/London /usr/bin/date '+%H'`
#MINUTE=Europe/London /usr/bin/date '+%M'
prstat -a > logfile.log-$YEAR-$MONTH-$DAY-$HOUR &
Thanks mehrdad.
Will try this.