perl/bash script to monitor all processes running in my machine
hi
i would like to monitor the processes running in my linux machine, ps ax >> day1.txt ps ax>> day2.txt diff day1.txt day2.txt from here if there is any new process, there should be a mail forwarded to my mail id, i am very much new to this perl script, if anyone has similar kind of perl script please help me thanks |
You can't do this with diff. The output of ps ax is going to change daily regardless of if there are new processes or not. The CPU time, state information and so forth are going to change constantly.
Having said that, you could do the whole thing in sh with a combination of ps, awk, sort, diff and mail. If you'd like an example, reply back. |
Quote:
|
thanks sigsegv
I would like to have an example? will you please guide me? |
Something like this should do the trick:
Code:
#!/bin/sh |
All times are GMT -5. The time now is 06:48 PM. |