![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 | 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 01:59 AM |
| Creation of output file from list of file | ganapati | Shell Programming and Scripting | 7 | 01-18-2008 04:55 PM |
| compare file size from a output file from a script | moustik | Shell Programming and Scripting | 7 | 11-07-2007 07:17 AM |
| HP-UX and 'top' | deckard | HP-UX | 8 | 07-21-2005 02:04 PM |
| Dual CPU's and 'top' | hcclnoodles | UNIX for Dummies Questions & Answers | 3 | 07-17-2003 10:15 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
catpure output of 'top' in a file
Code:
#!/bin/sh echo `date +%F:%T` >> top.out echo `top -n1` >> top.out 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 Last edited by new2ss; 11-06-2007 at 02:50 AM. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
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. |
|||
| Google The UNIX and Linux Forums |