WARNING: TimeTrex maintenance jobs have not run in the last

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

WARNING: TimeTrex maintenance jobs have not run in the last

Post by mistermudd »

I get this error when I start TimeTrex. When I check the "timetrex_cron_last_executed.log" file, it appears current and is updated every minute.

When I ran setup I was not given the option to schedule maintenance jobs, and when I saw this error I looked on the forumjs and saw that I needed to run the "C:\Program Files\TimeTrex\timetrex\interface\install\MaintenanceJobs.php". When I directed my browser to it it said I needed to enable install in my timetrex.ini.php file, so I did.

When I re-ran the "C:\Program Files\TimeTrex\timetrex\interface\install\MaintenanceJobs.php" file it gave me a command to run, so I opened a command prompt, ran the command and all appeared fine.

It has been about 48 hours since I ran the command and the error persists.

What did I do wrong?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Did you use the Windows binary installer to install TimeTrex originally? Or the TimeTrex .ZIP file?

The cron.php command needs to be run every minute from the Windows scheduler. The C:\Program Files\TimeTrex\timetrex\interface\install\MaintenanceJobs.php page should have given you instructions on how to setup the Windows scheduler to do this.
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

Post by mistermudd »

Yes I used the binary only.

The instructions it gave me:
In Windows simply run this command as Administrator. Be sure that php-win.exe is in your path!

schtasks /create /tn "TimeTrex Scheduled Jobs" /tr "php-win.exe C:\Program Files\TimeTrex\timetrex\classes\modules\core\..\..\..\maint\cron.php" /sc minute
I did so, and I checked that there is a scheduled task in the windows task scheduler, and it is, and it set to run every minute.

Checking the cron log it seems to be running every minute.

(also be advised that regardless of how many times I have tried the windows installer, it never gives me the option to setup maintanence jobs.)
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

The Windows binary installer attempts to configure the scheduler for you. For some reason it appears that it has failed.

Can you run the following SQL query from the SQL console:

Code: Select all

select * from cron;
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

Post by mistermudd »

I ran the command, here is the output.

Code: Select all

timetrex=> select * from cron;
 id | status_id |             name             | minute | hour | day_of_month |
month | day_of_week |             command              |     last_run_date
| created_date | created_by | updated_date | updated_by | deleted_date | deleted
_by | deleted
----+-----------+------------------------------+--------+------+--------------+-
------+-------------+----------------------------------+------------------------
+--------------+------------+--------------+------------+--------------+--------
----+---------
  8 |        10 | CheckForUpdate               | 41     | 9    | *            |
*     | *           | CheckForUpdate.php               | 2007-09-16 02:41:00-07
|   1189578431 |            |   1189980296 |            |              |
    |       0
  2 |        10 | AddUserDate                  | 15     | 0    | *            |
*     | *           | AddUserDate.php                  | 2007-09-15 17:15:00-07
|   1189578431 |            |   1189980297 |            |              |
    |       0
  6 |        10 | UserCount                    | 15     | 1    | *            |
*     | *           | UserCount.php                    | 2007-09-15 18:15:00-07
|   1189578431 |            |   1189980297 |            |              |
    |       0
  1 |        10 | AddPayPeriod                 | 0      | 0    | *            |
*     | *           | AddPayPeriod.php                 | 2007-09-15 17:01:00-07
|   1189578431 |            |   1189980297 |            |              |
    |       0
  3 |        10 | calcExceptions               | 30     | 0    | *            |
*     | *           | calcExceptions.php               | 2007-09-15 17:31:00-07
|   1189578431 |            |   1189980297 |            |              |
    |       0
  4 |        10 | AddRecurringPayStubAmendment | 45     | 0    | *            |
*     | *           | AddRecurringPayStubAmendment.php | 2007-09-15 17:45:00-07
|   1189578431 |            |   1189980297 |            |              |
    |       0
  5 |        10 | AddRecurringHoliday          | 55     | 0    | *            |
*     | *           | AddRecurringHoliday.php          | 2007-09-15 17:55:00-07
|   1189578431 |            |   1189980297 |            |              |
    |       0
  9 |        10 | AddAccrualPolicyTime         | 30     | 1    | *            |
*     | *           | AddAccrualPolicyTime.php         | 2007-09-15 18:31:00-07
|   1189578454 |            |   1189980297 |            |              |
    |       0
 10 |        10 | UpdateCurrencyRates          | 45     | 1    | *            |
*     | *           | UpdateCurrencyRates.php          | 2007-09-15 18:45:00-07
|   1189578454 |            |   1189980297 |            |              |
    |       0
  7 |        10 | AddRecurringScheduleShift    | 20,50  | *    | *            |
*     | *           | AddRecurringScheduleShift.php    | 2007-09-19 21:51:00-07
|   1189578431 |            |   1190263801 |            |              |
    |       0
 11 |        10 | TimeClockSync                | *      | *    | *            |
*     | *           | TimeClockSync.php                | 2007-09-19 21:43:00-07
|   1189578455 |            |   1190285040 |            |              |
    |       0
(11 rows)

timetrex=>
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

That shows that the maintenance tasks were running fine until September 19th. What happened after that date that caused them to stop working, any ideas?

Code: Select all

php-win.exe C:\Program Files\TimeTrex\timetrex\classes\modules\core\..\..\..\maint\cron.php
Is that the exact line that Windows Scheduler is running? If so, try running it manually from the command prompt to make sure it works. php-win.exe may not be in your PATH, so it could be failing due to that.
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

Post by mistermudd »

Code: Select all

"php-win.exe C:\Program Files\TimeTrex\timetrex\classes\modules\core\..\..\..\maint\cron.php"
That command actually seems to point to the wrong directory.

Code: Select all

"C:\Program Files\TimeTrex\php\php-win.exe" C:\Program Files\TimeTrex\timetrex\maint\cron.php
That was the right directory, so I went ahead and changed it in the task scheduler.

I had previously uninstalled, then reinstalled to 2.1.0-rc1 then upgraded to rc2. I wonder if maybe somewhere in there I goofed up.

We will see how it goes.
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

Post by mistermudd »

:-\

Still the output of the "select * from cron;" command is the same.

When I run the command manually from command prompt, it drops to a fresh prompt without any errors, but still the result is the same.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Do you turn your computer off at night by chance?
mistermudd
Posts: 34
Joined: Wed Sep 12, 2007 2:50 pm

Post by mistermudd »

Yeah.

I didn't know it had to run for 48 hours straight.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Currently TimeTrex won't work if you turn the computer off at all. It needs to run its maintenance tasks at specific times usually around midnight-1am. If the computer is off it can't run them and TimeTrex is unable to work properly without them.

TimeTrex is an enterprise application, and as such it is designed to run on a server that is left powered on 24/7.
Locked