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


#1

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.


#2

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.


#3

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

Try this:

wget 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


#4

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

Try this:

wget 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 http://dev.scharfie.com/accounts/login 2>&1 > /dev/null

Any thoughts would be greatly appreciated :slight_smile:


#5

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 http://dev.scharfie.com/accounts/login 2>&1 > /dev/null

Any thoughts would be greatly appreciated :slight_smile:

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

*/5 * * * * wget http://dev.scharfie.com/accounts/login > /dev/null 2>&1

-a


#6

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