[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

`ps -ax` gets cut off when run from cron

Carl Lerche

9/8/2006 4:59:00 AM

Hello,

I have a simple ruby script that writes the content of `ps -ax` to a
file, when I call it myself, it runs fine, however when I set the
script in a cron job and cron calls it, the output is truncated at 80
characters, which is quite annoying. Any ideas as to why this is? I
have my PATH set in the crontab:

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

Thanks,
Carl Lerche

3 Answers

Paul Lutus

9/8/2006 6:48:00 AM

0

Carl Lerche wrote:

> Hello,
>
> I have a simple ruby script that writes the content of `ps -ax` to a
> file, when I call it myself, it runs fine, however when I set the
> script in a cron job and cron calls it, the output is truncated at 80
> characters, which is quite annoying. Any ideas as to why this is?

Code? Remember that cron jobs run in a different environment, often with
different permissions.

--
Paul Lutus
http://www.ara...

Paul Battley

9/8/2006 7:09:00 AM

0

On 08/09/06, Carl Lerche <carl.lerche@verizon.net> wrote:
> I have a simple ruby script that writes the content of `ps -ax` to a
> file, when I call it myself, it runs fine, however when I set the
> script in a cron job and cron calls it, the output is truncated at 80
> characters, which is quite annoying. Any ideas as to why this is? I
> have my PATH set in the crontab:

Try `ps -axwww` instead.

Paul

Carl Lerche

9/8/2006 7:16:00 AM

0

Hey, that did it! Dumb of me not to check the man pages for ps...
didn't think of it.

Thanks for the help!
-carl

On Sep 8, 2006, at 12:09 AM, Paul Battley wrote:

> On 08/09/06, Carl Lerche <carl.lerche@verizon.net> wrote:
>> I have a simple ruby script that writes the content of `ps -ax` to a
>> file, when I call it myself, it runs fine, however when I set the
>> script in a cron job and cron calls it, the output is truncated at 80
>> characters, which is quite annoying. Any ideas as to why this is? I
>> have my PATH set in the crontab:
>
> Try `ps -axwww` instead.
>
> Paul
>