Quiz-1

create a script that displays the time and date, lists all logged-in users, and gives the system uptime and then saves this information to a logfile.

1. Creating a script to clean up the log files in /var/log

#!/bin/bash
# Script Name: logfile1.sh
# Run as oracle user.
LOGFILE=/home/oracle/admin/log/testlog1.log
echo "Today is: `date` " >> $LOGFILE
echo "List of user: `finger` " >> $LOGFILE
echo `uptime` >> $LOGFILE

exit 0

uptime: Shows how long the system has been running, along with associated statistics. A load average of 1 or less indicates that the system handles processes immediately. A load average greater than 1 means that processes are being queued. When the load average gets above 3, then system performance is significantly degraded.

No comments:

OTN Discussion Forums: Message List - Database - General

Ask Tom HOT ARTICLES

 
© Copyright 2008 - 2011. All rights reserved to dba-sansar.blogspot.com.
All other blogs, posts and entries are the property of their respective authors.
Please email us for your comments and suggessions Click Here