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:
Post a Comment