Sale!

COMP-8567 Assignment 04 solution

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (6 votes)

Write a Bash script named monitor.sh that continuously monitors all the current user processes (ps -u)
and whenever any user process p has more than 6 descendants, do the following:
1. Output the process tree with p as the root on the standard output (you can use pstree -p
processid). A sample output of pstree is shown in the screenshot below
Note: Consider all the descendants and not just the direct descendants.
2. A timestamp (date and time) is entered into log.txt followed by the contents of pstree -p processid
Submission Instructions:
 You are required test your program by dynamically creating or increasing the number of child
processes
 Log.txt must have at least 10 entries
 Submit two files: monitor.sh and log.txt
Sample Screenshot showing the output of ps-u and pstree