Crons In Ubuntu

Shockey

2[H]4U
Joined
Nov 24, 2008
Messages
2,283
Hello everyone,

I seem to be having problems with a few cron jobs that don't seem to want to run.

we changed the directories of the script recently and i started noticing that the script weren't running.

So i ran it manually. Turns out to be, I was missing a need database connect file. Fixed it and it ran fine in my browser. (All 3 files worked in browser) But still will not execute by cron.

I loooked on google and it said to see if the crons are executing with this command

grep cron /var/log/syslog

It showed me that every cron command was being executed except the proxy ones(Shown in red)

All of these crons were created by the same user.

0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * * lynx -dump http://domain.com/cron/cronRun.php
0 0 * * * lynx -dump http://domain.com/cron/cronReset.php
0,5,10,15,20,25,30,35,40,45,50,55 * * * * lynx -dump http://domain.com/cron/xxx.php
0 15 * * * lynx -dump http://domain.com/cron/proxy/grabProxies.php
5 15 * * * lynx -dump http://domain.com/cron/proxy/testProxies.php
50 14 * * * lynx -dump http://domain.com/cron/proxy/portDB.php

0,5,10,15,20,25,30,35,40,45,50,55 * * * * lynx -dump http://domain.com/cron/xxxxxxList.php
5,35 * * * * lynx -dump http://domain.com/cron/OfflineTimes.php


Could anyone point me as to where to look at what the problem is?
Does cron have an error log by default?


Thanks for any help, Shockey :)
 
You should simplify your cron to run something every five minutes:
Code:
*/5 * * * *
every two minutes:
Code:
*/2 * * * *
Not that this will fix your problem, but just wanted to point it out.
 
Are you logging your cron output? That would be a good place to start.

Other than that, I would say you should probably use the full path to lynx, but since it seems to be working fine for your other jobs, I don't see that as the issue.

I would try running the cronjob manually from command line and see if it has issues. Make sure you attempt to run it from user who will be executing the cron.
Code:
lynx -dump http://domain.com/cron/proxy/grabProxies.php

Other factors are an .htaccess in the /proxy/ dir may be denying access, permission issues, etc.
 
Are you logging your cron output? That would be a good place to start.

Other than that, I would say you should probably use the full path to lynx, but since it seems to be working fine for your other jobs, I don't see that as the issue.

I would try running the cronjob manually from command line and see if it has issues. Make sure you attempt to run it from user who will be executing the cron.
Code:
lynx -dump http://domain.com/cron/proxy/grabProxies.php

Other factors are an .htaccess in the /proxy/ dir may be denying access, permission issues, etc.

Not that I'm aware of no logging. I certainly will.

no .htaccess in this folder.

Turns out our security feature built into the script was causing the error, It check the ip connecting to it with the ip of the server in the database normally. For some reason it was hard coded in. didn't notice when i checked it.

Thanks for all the help, Your .htaccess made me rethink what was wrong.

Thanks for the tip about setting crons to /2. That will be helpful :)
 
Back
Top