Welcome to WebmasterWorld Guest from 18.207.238.169

Forum Moderators: bakedjake

Message Too Old, No Replies

Cron and top

can get top to work

     
3:08 am on May 8, 2006 (gmt 0)

New User

10+ Year Member

joined:May 8, 2006
posts:8
votes: 0


I added this line using cron -e
*/10 * * * * /usr/bin/top -n1 > /tmp/toplog/top

the problem is the /tmp/toplog/top file is always empty. I can see from the file modification time that it's updated every ten minutes but it's still as empty as ever. Running the top command directly from the shell give the intended result ( the file isn't empty ) but i just can't get it to work using cron.

Please help

8:18 pm on May 8, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Apr 12, 2005
posts:371
votes: 0


painless,

Welcome to WebmasterWorld!

When running top in a batch mode like this, you usually need to add the -b flag, ala:

*/10 * * * * /usr/bin/top -b -n1 > /tmp/toplog/top

Give that a try, hopefully it will work a little better for you.

Chad

3:03 am on May 9, 2006 (gmt 0)

New User

10+ Year Member

joined:May 8, 2006
posts:8
votes: 0


Thanks ChadSEO, it works now :)
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members