# RE: Does your \*shared\* hosting account work without errors?

**URL:** <https://www.ruby-forum.com/t/re-does-your-shared-hosting-account-work-without-errors/68942>\
**Category:** Rails\
**Created:** [February 15, 2006, 11:17pm UTC](https://www.ruby-forum.com/t/re-does-your-shared-hosting-account-work-without-errors/68942 "2006-02-15T23:17:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![HoganS\_Brian\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de0a6/32.png) [@HoganS\_Brian\_P](https://www.ruby-forum.com/u/HoganS_Brian_P)\
**Post date:** [February 15, 2006, 11:17pm UTC](https://www.ruby-forum.com/t/re-does-your-shared-hosting-account-work-without-errors/68942/1 "2006-02-15T23:17:59Z")

</div>

Dreamhost works fine for the apps I have. I have to use a modified  
dispatch.fcgi file so my app stays stable (no more 500 erros), and I use  
cron jobs to keep my applications alive.

---

<div class="post-metadata">

**Author:** ![HoganS\_Brian\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de0a6/32.png) [@HoganS\_Brian\_P](https://www.ruby-forum.com/u/HoganS_Brian_P)\
**Post date:** [February 16, 2006, 2:10am UTC](https://www.ruby-forum.com/t/re-does-your-shared-hosting-account-work-without-errors/68942/2 "2006-02-16T02:10:29Z")

</div>

Hogan, Brian P. wrote:

> Dreamhost works fine for the apps I have. I have to use a modified  
> dispatch.fcgi file so my app stays stable (no more 500 erros), and I use  
> cron jobs to keep my applications alive.

I’ve been using cron jobs as a keepalive, as well. Are you using wget  
or curl or ? With wget, I cannot seem to keep it from making an output  
file, despite using the switches to disable output.

---

<div class="post-metadata">

**Author:** ![HoganS\_Brian\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de0a6/32.png) [@HoganS\_Brian\_P](https://www.ruby-forum.com/u/HoganS_Brian_P)\
**Post date:** [February 16, 2006, 8:00am UTC](https://www.ruby-forum.com/t/re-does-your-shared-hosting-account-work-without-errors/68942/3 "2006-02-16T08:00:57Z")

</div>

On Feb 15, 2006, at 5:10 PM, Chris S. wrote:

> –
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

```
Try this:

```

wget [http://example.com/foo/bar](http://example.com/foo/bar) 2\>&1 \> /dev/null

Cheers-  
-Ezra Z.  
WebMaster  
Yakima Herald-Republic Newspaper  
removed\_email\_address@domain.invalid  
509-577-7732

---

<div class="post-metadata">

**Author:** ![HoganS\_Brian\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de0a6/32.png) [@HoganS\_Brian\_P](https://www.ruby-forum.com/u/HoganS_Brian_P)\
**Post date:** [February 16, 2006, 12:42pm UTC](https://www.ruby-forum.com/t/re-does-your-shared-hosting-account-work-without-errors/68942/4 "2006-02-16T12:42:57Z")

</div>

Ezra Z. wrote:

> On Feb 15, 2006, at 5:10 PM, Chris S. wrote:
> 
> > –
> > 
> > * * *
> > 
> > Rails mailing list  
> > removed\_email\_address@domain.invalid  
> > [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
> 
> Try this:
> 
> wget [http://example.com/foo/bar](http://example.com/foo/bar) 2\>&1 \> /dev/null
> 
> Cheers-  
> -Ezra Z.  
> WebMaster  
> Yakima Herald-Republic Newspaper  
> removed\_email\_address@domain.invalid  
> 509-577-7732

Hmm, seems like no matter what I do I either have output files  
generated, or I get emails from cron.

The full line is something like this:

\*/5 \* \* \* \* wget [HugeDomains.com](http://dev.scharfie.com/accounts/login) 2\>&1 \> /dev/null

Any thoughts would be greatly appreciated 🙂

---

<div class="post-metadata">

**Author:** ![HoganS\_Brian\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de0a6/32.png) [@HoganS\_Brian\_P](https://www.ruby-forum.com/u/HoganS_Brian_P)\
**Post date:** [February 16, 2006, 5:06pm UTC](https://www.ruby-forum.com/t/re-does-your-shared-hosting-account-work-without-errors/68942/5 "2006-02-16T17:06:57Z")

</div>

Chris S. wrote:

> Hmm, seems like no matter what I do I either have output files  
> generated, or I get emails from cron.
> 
> The full line is something like this:
> 
> \*/5 \* \* \* \* wget [HugeDomains.com](http://dev.scharfie.com/accounts/login) 2\>&1 \> /dev/null
> 
> Any thoughts would be greatly appreciated 🙂

I’ve have to reverse the redirections on some systems for it to work  
properly in cron. Not sure why. Anyway try:

\*/5 \* \* \* \* wget [HugeDomains.com](http://dev.scharfie.com/accounts/login) \> /dev/null 2\>&1

-a

---

<div class="post-metadata">

**Author:** ![HoganS\_Brian\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/9de0a6/32.png) [@HoganS\_Brian\_P](https://www.ruby-forum.com/u/HoganS_Brian_P)\
**Post date:** [February 16, 2006, 5:38pm UTC](https://www.ruby-forum.com/t/re-does-your-shared-hosting-account-work-without-errors/68942/6 "2006-02-16T17:38:11Z")

</div>

At 2/16/2006 11:06 AM, you wrote:

> I’ve have to reverse the redirections on some systems for it to work  
> properly in cron. Not sure why. Anyway try:
> 
> \*/5 \* \* \* \* wget [Scharfie.com is for sale | HugeDomains](http://dev.scharfie.com/accounts/login) \> /dev/null 2\>&1
> 
> -a

The redirections are processed when encountered so “2\>&1” means  
“connect STDERR to whatever STDOUT is right now” which is probably  
being captured by cron and then you change STDOUT to go to /dev/null.

cron probably acts something like:  
(command) \>watchoutput 2\>&1 \<&-  
if [[-s watchoutput]]; then mail user \< watchoutput; fi

When you put your actual command in and expand what the shell will do  
_in the order that it would appear to happen_, you’d get:

wget [Scharfie.com is for sale | HugeDomains](http://dev.scharfie.com/accounts/login) \>watchoutput 2\>&1  
\<&- \>/dev/null 2\>&1

send stdout to watchoutput  
send stderr to where stdout goes (and that’s watchoutput)  
close stdin (it might be closer to “\</dev/null” than “\<&-”, but the  
point is the same)  
call the user’s command  
send stdout to /dev/null  
send stderr to where stdout goes (and that’s /dev/null)  
wait for command to finish  
see if there’s any output in watchoutput and email it to user

-Rob
