cron job times out

N

Nikola Skoric

Hello,

I have a few lines of code retrieving a web page and saving some
variables from it to a log. And everything works nice from command line.
but, when I make a cron job, I get an error:

Your "cron" job on fly
cd $HOME/bin/ ; python newartlog.py ; cd

produced the following output:

Traceback (most recent call last):
File "newartlog.py", line 11, in ?
response = urllib2.urlopen(req)
File "/usr/local/lib/python2.4/urllib2.py", line 130, in urlopen
return _opener.open(url, data)
File "/usr/local/lib/python2.4/urllib2.py", line 358, in open
response = self._open(req, data)
File "/usr/local/lib/python2.4/urllib2.py", line 376, in _open
'_open', req)
File "/usr/local/lib/python2.4/urllib2.py", line 337, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.4/urllib2.py", line 1021, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/local/lib/python2.4/urllib2.py", line 996, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error (145, 'Connection timed out')>

It seems that the connection timed out. But, every time I execute the
script from the command line, everything goes fine. And every time he
cron job triggers, it times out. How come?
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top