Maintenance Job does not run - HOUR Mismatch

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
vmp
Posts: 99
Joined: Wed Jun 20, 2007 3:41 am

Maintenance Job does not run - HOUR Mismatch

Post by vmp »

Since I was getting the warning "WARNING: TimeTrex maintenance jobs have not run in the last 48hours. Please contact your TimeTrex administrator immediately." I ran the the cron.php manually at the command prompt but I'm getting the below mentioned output when cron.php runs.
Eventually no maintenance jobs run.
Kindly advise.

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
<br>
<b>Debug Buffer</b><br>
============================================================================<br>
Memory Usage: 2880456<br>
----------------------------------------------------------------------------<br>
DEBUG [200]: <b>[Function]()</b>: URI: C:\xampp\htdocs\TimeTrex\maint\cron.php<br>
DEBUG [202]: <b>[Function]()</b>: Production: 1<br>
DEBUG [374]: <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job is scheduled to run: AddPayPeriod<br>
DEBUG [382]: <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1182858060 - 26-Jun-07 3:41 PM MSD<br>
DEBUG [388]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches: 2<br>
DEBUG [393]: <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 6<br>
DEBUG [398]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches: 6<br>
DEBUG [423]: <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match: 15<br>
DEBUG [374]: <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job is scheduled to run: AddUserDate<br>
DEBUG [382]: <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1182858060 - 26-Jun-07 3:41 PM MSD<br>
DEBUG [388]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches: 2<br>
DEBUG [393]: <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 6<br>
DEBUG [398]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches: 6<br>
DEBUG [423]: <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match: 15<br>
DEBUG [374]: <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job is scheduled to run: calcExceptions<br>
DEBUG [382]: <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1182858060 - 26-Jun-07 3:41 PM MSD<br>
DEBUG [388]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches: 2<br>
DEBUG [393]: <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 6<br>
DEBUG [398]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches: 6<br>
DEBUG [423]: <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match: 15<br>
DEBUG [374]: <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job is scheduled to run: AddRecurringPayStubAmendment<br>
DEBUG [382]: <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1182858060 - 26-Jun-07 3:41 PM MSD<br>
DEBUG [388]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches: 2<br>
DEBUG [393]: <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 6<br>
DEBUG [398]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches: 6<br>
DEBUG [423]: <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match: 15<br>
DEBUG [374]: <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job is scheduled to run: AddRecurringHoliday<br>
DEBUG [382]: <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1182858060 - 26-Jun-07 3:41 PM MSD<br>
DEBUG [388]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches: 2<br>
DEBUG [393]: <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 6<br>
DEBUG [398]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches: 6<br>
DEBUG [423]: <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match: 15<br>
DEBUG [374]: <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job is scheduled to run: UserCount<br>
DEBUG [382]: <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1182858060 - 26-Jun-07 3:41 PM MSD<br>
DEBUG [388]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches: 2<br>
DEBUG [393]: <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 6<br>
DEBUG [398]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches: 6<br>
DEBUG [423]: <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match: 15<br>
DEBUG [374]: <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job is scheduled to run: AddRecurringScheduleShift<br>
DEBUG [382]: <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1182858060 - 26-Jun-07 3:41 PM MSD<br>
DEBUG [388]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches: 2<br>
DEBUG [393]: <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 6<br>
DEBUG [398]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches: 6<br>
DEBUG [403]: <b>CronJobFactory::isScheduledToRun()</b>: Hour Matches: 6<br>
DEBUG [419]: <b>CronJobFactory::isScheduledToRun()</b>: Minute DOES NOT Match: 41<br>
DEBUG [374]: <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job is scheduled to run: CheckForUpdate<br>
DEBUG [382]: <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1182858060 - 26-Jun-07 3:41 PM MSD<br>
DEBUG [388]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches: 2<br>
DEBUG [393]: <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 6<br>
DEBUG [398]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches: 6<br>
DEBUG [423]: <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match: 15<br>
DEBUG [374]: <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job is scheduled to run: AddAccrualPolicyTime<br>
DEBUG [382]: <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1182858060 - 26-Jun-07 3:41 PM MSD<br>
DEBUG [388]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches: 2<br>
DEBUG [393]: <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 6<br>
DEBUG [398]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches: 6<br>
DEBUG [423]: <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match: 15<br>
DEBUG [374]: <b>CronJobFactory::isScheduledToRun()</b>: Checking if Cron Job is scheduled to run: UpdateCurrencyRates<br>
DEBUG [382]: <b>CronJobFactory::isScheduledToRun()</b>: Epoch: 1182858060 - 26-Jun-07 3:41 PM MSD<br>
DEBUG [388]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Week Matches: 2<br>
DEBUG [393]: <b>CronJobFactory::isScheduledToRun()</b>: Month Matches: 6<br>
DEBUG [398]: <b>CronJobFactory::isScheduledToRun()</b>: Day Of Month Matches: 6<br>
DEBUG [423]: <b>CronJobFactory::isScheduledToRun()</b>: Hour DOES NOT Match: 15<br>
DEBUG [51]: <b>[Function]()</b>: CRON: Jobs Executed: 0 of 10<br>
============================================================================<br>
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

That is actually perfectly normal, TimeTrex has its own scheduler built in which only runs jobs at given times, so cron.php is executed every minute, but only 2-3 times an hour does it actually do anything.

So the good news is that the maintenance jobs run fine when you execute them manually, the question becomes how come they aren't being run every minute automatically?

Are you running Windows or Linux?
vmp
Posts: 99
Joined: Wed Jun 20, 2007 3:41 am

Post by vmp »

I am running Windows.

Why do I still get the message "WARNING: TimeTrex maintenance jobs have not run in the last 48hours. Please contact your TimeTrex administrator immediately." in RED when logged into TimeTrex?

In addition when I go to Help --> About I get the under System Information, Maintenance Jobs Last Ran: Never
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

The reason you are still getting the message is because cron.php hasn't been run at the exact times it needs to be to actually execute the jobs. Which is why it needs to be run every minute for 24hrs straight before that message will disappear.

So I would look at your scheduled tasks in Windows and make sure it is executing cron.php properly and every minute.

Are you running Windows XP? During installation did you run the command to add cron.php to your Scheduled Tasks?
[Hari]
Posts: 8
Joined: Wed Jun 20, 2007 11:41 pm

Post by [Hari] »

vmp wrote:I am running Windows.

Why do I still get the message "WARNING: TimeTrex maintenance jobs have not run in the last 48hours. Please contact your TimeTrex administrator immediately." in RED when logged into TimeTrex?

In addition when I go to Help --> About I get the under System Information, Maintenance Jobs Last Ran: Never

Just trying to help...

first, where your php-win.exe and your cron.php is installed???
example,
c:/program files/xampp/php/php-win.exe
c:/program files/xampp/htdocs/timetrex/maint/cron.php
vmp
Posts: 99
Joined: Wed Jun 20, 2007 3:41 am

Post by vmp »

I'm running Window XP.
I setup the scheduled task to run every minute and the Warning message no more appears.
mountdigit
Posts: 8
Joined: Wed Jul 22, 2009 3:14 am

Post by mountdigit »

VMP

can you please tell me what did you put in to add the cron on windows task scheduler:

What did you put in

Run:

Start in:

Run as:
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Please see this post for an example command to add the maintenance jobs to your windows task scheduler.
http://forums.timetrex.com/viewtopic.php?p=162#162
erock
Posts: 3
Joined: Fri Sep 04, 2009 10:53 am

Questions about 'time trex has not run maintenance job in 48

Post by erock »

Greetings.

I have been running time trex in a test environment for the last week, I have not been successful at removing the dreaded 'maintenance has not been run in 48 hours' message.

I am hoping someone can help with these questions:

1) The install is only one week old. I found a post that suggested the task scheduler credentials should be changed to an administrator (it was set up as a SYSTEM account). This change is only 8 hours old.. what are the odds this is going to clear everything up? (I've read so many potential fixes, and nothing has worked, that I am losing faith).

2) I am running Windows Vista Business

3) The help/about menu shows that maintenance has never been run, I assume this will change once the magical cron job gets run at some point?

4) I checked the existng task scheduler job; it points to the location of php-win, and cron. The task was set up by the TimeTrex install..

5) The task scheduler reports a 'last result code' of (0x1) which suggests it did not fire properly.. is this normal for the first 24 hours? The task does run every minute:

C:\Program Files\TimeTrex\php\php-win.exe
C:\Program Files\TimeTrex\timetrex\maint\cron.php

I'd really like to get this running properly before next week.. so any help before the long weekend is appreciated!

Thanks in advance,

E
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

If you are still getting 'last result code' of (0x1) after you changed the scheduled task account to Administrator than the problem likely is still going to persist.

Have you tried running the scheduled task command manually from a command prompt to see if any error message appear?
erock
Posts: 3
Joined: Fri Sep 04, 2009 10:53 am

Questions about 'time trex has not run maintenance job in 48

Post by erock »

I think I may have resolved this issue, we'll see in 24 hours I guess.

I have little experience with php, so in order to run the cron job with output, I had to do a little research.

It appears to me, that php.win.exe is designed to run without a command window, and therefore is limited and cannot output it's results. Is this correct?

Running php.exe on cron.php did return some results. In a command window it said '1 of 11 jobs completed' and a comment about waiting and about letting it do its thing over time.

I then went and mucked with the scheduled task that was set up by time trex, and noted that I think the syntax in there is wrong. I think the program/script, and arguments both need to be wrapped in quotes in order to the task to run properly..

Once I did that, the scheduler reported that the task had completed successfully.

I discovered this by accident, by deciding to change the scheduled task from php-win.exe, to just php.exe. Only when I added the quotes, was I able to reproduce the "1 out of 11" output that I obserrved directly from the command line..

If any of this makes sense, I'd appreciate hearing any additional feedback..

Thanks in advance (fingers crossed),

E
erock
Posts: 3
Joined: Fri Sep 04, 2009 10:53 am

adding quotes fixed it..

Post by erock »

adding quotes to the syntax in the scheduler fixed it
Locked