Answered step by step
Verified Expert Solution
Question
1 Approved Answer
List For Specific Day Specifying a--datein YYYY-MM-DD format should list all users or hosts that were logged in at some point during that date, even
List For Specific Day
Specifying a--datein YYYY-MM-DD format should list all users or hosts that were logged in at some point during that date, even if their start time or end time is different. For example, usercwsmithlogged in on Feb 14 and logged off on Feb 15, but they show up when the following command is run:
[eric@centos7 a2]$ ./assignment2.py -l user -d 2018-02-14 usage_data_file User list for usage_data_file ============================= cwsmith
This should work for hosts as well:
[eric@centos7 a2]$ ./assignment2.py -l host -d 2018-02-14 usage_data_file Host list for usage_data_file ============================= 10.40.105.130
If the user types in an invalid date, the script should halt and print the following error message:
[eric@centos7 a2]$ ./assignment2.py -l host -d 2018-02-xx usage_data_file Date not recognized. Use YYYY-MM-DD format.
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