|
|
|
|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
catpure output of 'top' in a file
Code:
#!/bin/sh echo `date +%F:%T` >> top.out echo `top -n1` >> top.out Hi all, i am trying to capture the output of the 'top' command in linux. when i run the command manually, it works. However, when i run it as a cronjob,the 'top' output is not being printed to the file,only the date is being printed. i have verified that the cron is working in the /var/log/cron file. any advise? i found the mistake. i need to specify -b as as option to top. Code:
top -b -n1 worked. Last edited by new2ss; 11-06-2007 at 05:50 AM.. |
| Sponsored Links | ||
|
|
|
|||
|
Check the path of top, eg use
which top then use the fully qualified path to the top program in the script. 99% of cron problems are due to the assumptions about the environment. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to parse through a file and based on condition form another output file | sivasu.india | UNIX for Advanced & Expert Users | 6 | 02-28-2008 04:59 AM |
| Creation of output file from list of file | ganapati | Shell Programming and Scripting | 7 | 01-18-2008 07:55 PM |
| compare file size from a output file from a script | moustik | Shell Programming and Scripting | 7 | 11-07-2007 10:17 AM |
| HP-UX and 'top' | deckard | HP-UX | 8 | 07-21-2005 06:04 PM |
| Dual CPU's and 'top' | hcclnoodles | UNIX for Dummies Questions & Answers | 3 | 07-17-2003 02:15 PM |