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

**URL:** <https://www.ruby-forum.com/t/ps-ax-gets-cut-off-when-run-from-cron/67973>\
**Category:** Ruby\
**Created:** [September 8, 2006, 6:58am UTC](https://www.ruby-forum.com/t/ps-ax-gets-cut-off-when-run-from-cron/67973 "2006-09-08T06:58:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![phillyloco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@phillyloco](https://www.ruby-forum.com/u/phillyloco)\
**Post date:** [September 8, 2006, 6:58am UTC](https://www.ruby-forum.com/t/ps-ax-gets-cut-off-when-run-from-cron/67973/1 "2006-09-08T06:58:58Z")

</div>

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 L.

---

<div class="post-metadata">

**Author:** ![phillyloco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@phillyloco](https://www.ruby-forum.com/u/phillyloco)\
**Post date:** [September 8, 2006, 8:55am UTC](https://www.ruby-forum.com/t/ps-ax-gets-cut-off-when-run-from-cron/67973/2 "2006-09-08T08:55:17Z")

</div>

Carl L. 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.

---

<div class="post-metadata">

**Author:** ![phillyloco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@phillyloco](https://www.ruby-forum.com/u/phillyloco)\
**Post date:** [September 8, 2006, 9:17am UTC](https://www.ruby-forum.com/t/ps-ax-gets-cut-off-when-run-from-cron/67973/3 "2006-09-08T09:17:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![phillyloco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@phillyloco](https://www.ruby-forum.com/u/phillyloco)\
**Post date:** [September 8, 2006, 9:11am UTC](https://www.ruby-forum.com/t/ps-ax-gets-cut-off-when-run-from-cron/67973/4 "2006-09-08T09:11:18Z")

</div>

On 08/09/06, Carl L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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
