This homework assignment needs to be performed individually on the Linux machines in the Linux Lab.
Write a bash script to count:
on a lab machine over three consecutive days (72 hours).
Write a bash script that executes commands to count the number of non-root processes, current memory usage percentage and the number of logged-in users on a system. Memory usage percentage can be calculated using the formula: current used memory ÷ total memory × 100%.
Set up this script to run once an hour over a three-day period. This means you must have everything ready to run at least three days before this due. Even then, you’re just hoping that everything goes perfectly the first and only time—not really a winning strategy. You live on the edge, sometimes, you fall off.
You must use
crontab to handle the automatic timing for running the
script. In other words, you set up your script to be run by
at specific times, so that you don't have to get up at 4:00ᴀᴍ.
Run the script and record the information for each of the performance tests. Make sure that the 3:00ᴘᴍ run doesn’t overwrite the 2:00ᴘᴍ data.
Disable your script by removing the crontab entry after this assignment is done.
Using any plotting facility you like, create the following six graphs:
Each of these, by the hour (72 tics on the X-axis):
Each of these, average by the day (three tics on the X-axis):
You may create your graphs by hand on graph paper, if you can generate a clean scan of your graph. A phone picture is not acceptable.
If you encounter “STACK FRAME LINK OVERFLOW”, then try this:
hw2.pdf, perhaps via Microsoft Word or LibreOffice.
It must contain:
crontabentry that you used
Via web checkin, or:
~ct320/bin/checkin HW2 hw2.pdf
Turn in someone else’s work.