urllib working differently when run from crontab

V

VictorMiller

I've written a python script which, using urllib, and urllib2 will
fetch a number of files that that I'm interested in from various
websites (they're updated everyday). When I run the script from my
command line everything works as intended. However, when the script
is run from crontab every single url that I attempt to open gets
"connection refused". Has anyone ever seen anything like this? If
so, what's causing it, and what can I do about it?

Victor
 
J

Jonathan Gardner

I've written a python script which, using urllib, and urllib2 will
fetch a number of files that that I'm interested in from various
websites (they're updated everyday).  When I run the script from my
command line everything works as intended.  However, when the script
is run from crontab every single url that I attempt to open gets
"connection refused".  Has anyone ever seen anything like this?  If
so, what's causing it, and what can I do about it?

Try su'ing as the user and running the scripts. Maybe that will shed
some light on the problem.
 
M

Matthew Woodcraft

I've written a python script which, using urllib, and urllib2 will
fetch a number of files that that I'm interested in from various
websites (they're updated everyday). When I run the script from my
command line everything works as intended. However, when the script
is run from crontab every single url that I attempt to open gets
"connection refused". Has anyone ever seen anything like this? If
so, what's causing it, and what can I do about it?

Perhaps you have an http_proxy environment variable set in the
interactive session but not in cron's environment?

-M-
 
V

VictorMiller

Perhaps you have an http_proxy environment variable set in the
interactive session but not in cron's environment?
Aha! Thanks, I think that that may indeed be the problem. I'll know
for sure tomorrow morning after I look at the trace of the run.

Victor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top