Run TOP from crontab
Posted on 2006-05-22
I don't know too much about unix, but am wanting to find a way to regularly have the ouput of top sent to a file. I run a line which works perfectly, but when I add it to a cron job it always fails. The line I am running is:
top -d1 > /rhc/nt1/top.txt
It works when I run it, but it won't work from a cron job. There is a couple of processes that we need to keep an eye on and if they get in the top 10 then i need to be notified. If i can't do it with top, is there any other way to get the top 10 processes.