Prosper202 nightly cron

Mike

New member
Jun 27, 2006
6,779
114
0
50
On the firing line
202 has a directory called 202-cronjobs

It's supposed to run at midnight and clear the clicks_spy table.

How can I ensure it is setup correctly?

We moved servers and put 202 on a RAID 10 SSD setup, but the nightly clicks_spy dump isn't working.

Ideas?
 


I've never used prosper (and don't deal in PHP), so this may not be the correct way, however this is where I would start:

run: 'crontab -e', find the relevant command in that file and then run the command manually, see what errors it spits out.
 
Thanks Jake, I did that. It's not a real cron job. It's a pseudo cron that's triggered by page loads, and it's supposed to run at midnight.

Last night, I saw it ran at 7pm CDT (00:00 GMT). So it ran at midnight GMT, but the server time is set to Eastern time. Trying to figure out why the script thinks it's GMT, not EDT.

/edit/

For PHP junkies:

Code:
<? include_once($_SERVER['DOCUMENT_ROOT'] . '/202-config/connect.php'); 


//heres the psuedo cronjobs
if (RunSecondsCronjob() == true) { 
    if (RunHourlyCronJob() == true) { 
        RunDailyCronjob();    
    }
}

function RunDailyCronjob() { 
//check to run the daily cronjob
    $now = time();

    $today_day = date('j', time());
    $today_month = date('n', time());
    $today_year = date('Y', time());

    //the click_time is recorded in the middle of the day
    $cronjob_time = mktime(12,0,0,$today_month,$today_day,$today_year);
    $mysql['cronjob_time'] = mysql_real_escape_string($cronjob_time);
    $mysql['cronjob_type'] = mysql_real_escape_string('daily');
    
    //check to make sure this click_summary doesn't already exist
    $check_sql = "SELECT  COUNT(*)  FROM 202_cronjobs WHERE cronjob_type='".$mysql['cronjob_type']."' AND cronjob_time='".$mysql['cronjob_time']."'";
    $check_result = _mysql_query($check_sql);
    $check_count = mysql_result($check_result,0,0);

That's just the first 27 lines of the "cron job" script they have. Even though the server is set to Eastern time, if I run
Code:
<?php  echo time(); ?>
it kicks back GMT time. I'm guessing somewhere in that script I need to adjust for GMT to EDT?
 
Depends what time the cron job runs. You have three times to look at -- server time, mySQL, and PHP default time zone.

I have no idea which one the software would be checking.