Quote:
Originally Posted by bigb89
How can I make a script that will pretty much run "top" (or any other commands that show resource usage) and then get the output from that command and email me the output every four hours?
|
Factors you will want to consider:
- Look at the -b switch to top(1) if you are using FreeBSD (-n on OpenBSD or NetBSD...). This will allow you to dump top output to a file.
- Study the cron(8) manpage for information on how to configure a script which will run at periodic times.
- Look at the manpage for whatever mail transport you are using. This may be sendmail(8).