Changes

Jump to: navigation, search

OPS435 Assignment 2 for Section C

35 bytes added, 16:04, 14 April 2021
Weekly Usage Report by Remote Host
Once you have created datetime objects, you can do useful things with them:
* <code> d1 > d2 </code> will return True is d1 is <b>later</b> thank than d2.
* <code> d2 - d1 </code> will return a <i>timedelta</i> object, which is an amount of time between d2 and d1.
<pre>
[eric@centos a2]$ ./a2assignment2.py -u rchan -t daily usage_data_file
</pre>
The following is a Daily Usage Report created for the Remote Host 10.40.105.103 by the command:
<pre>
[eric@centos7 a2]$ ./a2assignment2.py -r 10.40.105.130 -t daily usage_data_file
</pre>
<pre>
Weekly Usage Report for 10.4340.115105.162130
=====================================
Date Usage
Running the script with <B>no filename</b> as a file argument should call a subprocess.Popen object and run the command <code>last -Fiw</code>.
<pre>
[eric@mtrx-node06pd ~]$ ./a2assignment2.py -l user
</pre>
<pre>
[eric@mtrx-node06pd ~]$ ./a2assignment2.py -u adas20 -t daily
</pre>

Navigation menu