Yet another cron job question

Ask your questions regarding TimeTrex installation here.
Locked
wtpearson
Posts: 2
Joined: Tue Jul 31, 2007 10:02 am

Yet another cron job question

Post by wtpearson »

Hey guys, I've got timetrex up and running but I can't seem to get the cron job to run. Im using ubuntu linux 6.06

I used crontab -e and heres what I have

Code: Select all

***** su www-data -c "php var/www/apache2-default/timetrex/maint/cron.php"> /dev/null > 2 &1
when I run the job manually I get the hour mismatch problem. Here's the debug output.


Code: Select all

-----
(mysqlt): SET SESSION sql_mode='ansi'
-----
-----
(mysqlt):
                                        select  *
                                        from    cron
                                        WHERE deleted = 0 LIMIT 2147483647
-----
NOTE: Jobs are scheduled to run at specific times, therefore only some jobs are
Jobs Executed: 0 of 10
<br>
<b>Debug Buffer</b><br>
============================================================================<br>
Memory Usage: 2529168<br>
----------------------------------------------------------------------------<br>
DEBUG [206]:    <b>[Function]()</b>: URI: cron.php<br>
DEBUG [208]:    <b>[Function]()</b>: Production: 0<br>
DEBUG [374]:    <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job
DEBUG [382]:    <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1185901200 - 3
DEBUG [388]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches:
DEBUG [393]:    <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 7<br>
DEBUG [398]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches:
DEBUG [423]:    <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match:
DEBUG [374]:    <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job
DEBUG [382]:    <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1185901200 - 3
DEBUG [388]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches:
DEBUG [393]:    <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 7<br>
DEBUG [398]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches:
DEBUG [423]:    <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match:
DEBUG [374]:    <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job
DEBUG [382]:    <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1185901200 - 3
DEBUG [388]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches:
DEBUG [393]:    <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 7<br>
DEBUG [398]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches:
DEBUG [423]:    <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match:
DEBUG [374]:    <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job
DEBUG [382]:    <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1185901200 - 3
DEBUG [388]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches:
DEBUG [393]:    <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 7<br>
DEBUG [398]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches:
DEBUG [423]:    <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match:
DEBUG [374]:    <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job
DEBUG [382]:    <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1185901200 - 3
DEBUG [388]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches:
DEBUG [393]:    <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 7<br>
DEBUG [398]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches:
DEBUG [423]:    <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match:
DEBUG [374]:    <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job
DEBUG [382]:    <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1185901200 - 3
DEBUG [388]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches:
DEBUG [393]:    <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 7<br>
DEBUG [398]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches:
DEBUG [423]:    <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match:
DEBUG [374]:    <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job
DEBUG [382]:    <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1185901200 - 3
DEBUG [388]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches:
DEBUG [393]:    <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 7<br>
DEBUG [398]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches:
DEBUG [403]:    <b>CronJobFactory::isScheduledToRun()</b>: Hour Matches: 7<br>
DEBUG [419]:    <b>CronJobFactory::isScheduledToRun()</b>: Minute DOES NOT Match
DEBUG [374]:    <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job
DEBUG [382]:    <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1185901200 - 3
DEBUG [388]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches:
DEBUG [393]:    <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 7<br>
DEBUG [398]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches:
DEBUG [423]:    <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match:
DEBUG [374]:    <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job
DEBUG [382]:    <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1185901200 - 3
DEBUG [388]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches:
DEBUG [393]:    <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 7<br>
DEBUG [398]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches:
DEBUG [423]:    <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match:
DEBUG [374]:    <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job
DEBUG [382]:    <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1185901200 - 3
DEBUG [388]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches:
DEBUG [393]:    <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 7<br>
DEBUG [398]:    <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches:
DEBUG [423]:    <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match:
DEBUG [51]:     <b>[Function]()</b>: CRON: Jobs Executed: 0 of 10<br>
============================================================================<br>
I read in an earlier post that the hour mismatch wasn't a big deal. Any help with the situation would be greatly appreciated.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Are there spaces between your "*"? It should be:

* * * * * su www-data -c "php var/www/apache2-default/timetrex/maint/cron.php"> /dev/null > 2 &1

Also, try running the command manually:

su www-data -c "php var/www/apache2-default/timetrex/maint/cron.php"

Sometimes the www-data user doesn't have a shell set so "su" fails.
wtpearson
Posts: 2
Joined: Tue Jul 31, 2007 10:02 am

Post by wtpearson »

Ahh, the spaces between the asterisk may help. I ran the command manually and got the output below which I believe is a good sign.

Code: Select all

NOTE: Jobs are scheduled to run at specific times, therefore only some jobs are executed each time this file is run.
Jobs Executed: 0 of 10
I also set a shell for the www-data user, hopefully this will have it working.
Locked