If I understand your question, yes, it's the standard "top" command that normally you run interactively,
the various switches are -c = complete command line instead of just command name. -C = Individual CPU States and Summary CPU info -b = batch mode (So I can dump it to a file) -n1 = Iterations (1) -d1 = delay (needs to be something even though I am only doing 1 iteration) So the desired effect is to have cron wake up every 5 min and dumps a snapshot of the system to a file. I added the line: export COLUMNS=128 to the script just before the top execution. To be sure it was taking affect I added: echo $COLUMNS just after the top line, and it did get set to 128, yet the output file is still truncated at 80 columns. Thanks though... ----------------------------------- Jeremy Warren Sr. Systems Programmer KB Toy Stores mailto:[EMAIL PROTECTED]@kbtoys.com |---------+----------------------------> | | Tzafrir Cohen | | | <[EMAIL PROTECTED]| | | .ac.il> | | | Sent by: Linux on| | | 390 Port | | | <[EMAIL PROTECTED]| | | IST.EDU> | | | | | | | | | 03/25/2003 03:40 | | | PM | | | Please respond to| | | Linux on 390 Port| | | | |---------+----------------------------> >-----------------------------------------------------------------------------------------------------------------------------| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: [LINUX-390] Cron script redirect causing truncation | >-----------------------------------------------------------------------------------------------------------------------------| On Tue, Mar 25, 2003 at 04:15:11PM -0500, Jeremy Warren wrote: > I have a script which outputs top data periodically to a file using stdout > > top -c -C -b -d1 -n1 >> /kb/data/top/topout.$sname.txt What is this command, BTW? not the standard top from procps, right? > > When I run this by hand, the data in the topout file has the complete path > to the running processes. > When I run it via cron, everything gets truncated at 80 chars. I know this > is probably some session environment variable but I can't seem to come up > with the right answer in my googling... COLUMNS ? -- Tzafrir Cohen +---------------------------+ http://www.technion.ac.il/~tzafrir/ |vim is a mutt's best friend| mailto:[EMAIL PROTECTED] +---------------------------+
