Question
Write a script named lab6s2 that writes the current time and date, lists logged-in users, and prints the systems uptime to a log file. The
Write a script named lab6s2 that writes the current time and date, lists logged-in users, and prints the systems uptime to a log file. The time should be printed with the format of 03:55 am as opposed to military time. The date should be printed like this: 09/10/12 Numbers should be zero-padded to 2 digits (e.g. 03 instead of 3).
(It is advisable to look at the date commands many options to format your output. Also, use the uptime command to print system uptime.)
This output should be appended to a logfile named lab6s2.log. Create a cron job to execute this script every 2 minutes.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started