CRON JOBS PROBLEMS!!

/home/darkene3/public_html/periodic/cron.php: line 1: ?php: No such file or directory
/home/darkene3/public_html/periodic/cron.php: line 2: /README.archive: Permission denied
/home/darkene3/public_html/periodic/cron.php: line 3: access-logs: command not found
/home/darkene3/public_html/periodic/cron.php: line 4: access-logs: command not found
/home/darkene3/public_html/periodic/cron.php: line 5: access-logs: command not found
/home/darkene3/public_html/periodic/cron.php: line 6: syntax error near unexpected token `('
/home/darkene3/public_html/periodic/cron.php: line 6: `*     copyright            : (C) 2006 BoonEx Group'

 

 

These are the issues left for us to solve.

 

Can anyone help us please!!

 

Many Thanks

 

Nick Taylor

Quote · 1 Dec 2009

Could you post the whole command of the Cron Job? feel free to xxxx out your site name.

Chris

Nothing to see here
Quote · 1 Dec 2009

does your periodic/cron.php file look like this:

<?php
/***************************************************************************
*                            Dolphin Smart Community Builder

I have video tutorials to help you mrpowless.com
Quote · 1 Dec 2009

 

Could you post the whole command of the Cron Job? feel free to xxxx out your site name.

 

Chris

 

 <?php
/***************************************************************************
*                            Dolphin Smart Community Builder
*                              -----------------
*     begin                : Mon Mar 23 2006
*     copyright            : (C) 2006 BoonEx Group
*     website              : http://www.boonex.com/
* This file is part of Dolphin - Smart Community Builder
*
* Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License.
* http://creativecommons.org/licenses/by/3.0/
*
* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the Creative Commons Attribution 3.0 License for more details.
* You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin,
* see license.txt file; if not, write to marketing@boonex.com
***************************************************************************/

$GLOBALS['bx_profiler_disable'] = true;

$aPathInfo = pathinfo(__FILE__);
require_once ($aPathInfo['dirname'] . '/../inc/header.inc.php');
require_once(BX_DIRECTORY_PATH_INC . 'utils.inc.php');
require_once(BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolDb.php');

define('BX_DOL_CRON_EXECUTE', '1');

/*
 * This file is used for cron jobs. He is started system cron every minute.
 * The file runs jobs at regular intervals. These jobs are listed in `sys_cron_jobs` table.
 *
 * Fields shark_cron_jobs table:
 *  id - key for the table
 *  name - job name to be executed
 *  time - format of entries are five fields of numbers specifying the minute,
 *              hour, day of the month, month and day of the week that a task must be executed.
 *
 *              * * * * *
 *              | | | | |
 *              | | | | +--- day of week(0-6 with 0=Sunday)
 *              | | | +----- month(1-12)
 *              | | +------- day of month(1-31)
 *              | +--------- hour(0-23)
 *              +----------- minute(0-59)
 *
 *  class - class name which will run
 *  file - path to class file
 *  eval - source code which will run
 *
 * The time numbers can be given as a comma separated list of simple numbers,
 * ranges("2-5" is the same as "2,3,4,5"). A single "*" can be used in a field to indicate all
 * valid numbers in that field, so it translates to "always". If a given time is valid in all five
 * fields then a module function is executed. Here are a few examples that illustrate the possibilities:
 * 
 *  will run at 16:10:
 *  10 16
 *  will run at 2:00 on saturday:
 *  0 2 * * 6
 *  will run at midnight on new years:
 *  0 0 1 1 0
 *  will run every 15 minutes:
 *  *\/15
 *  will run at 22:00 on work weekdays:
 *  0 22 * * 1-5
 *  will run each 23 minutes, 2:00, 4:00 ..., everyday
 *  23 0-23/2
 *
 * Example add new cron job:
 *
 * 1. Create new class inherited from "BxDolCron" and add method "processing"
 *
 *      class BxDolCronMy extends BxDolCron {
 *     
 *          function processing()
 *          {
 *              // insert code
 *          }
 *      }
 *
 * 2. Add record in `sys_cron_jobs` table
 *
 * @see an example of BxDolCronNotifies, BxDolCronCupid, BxDolCronCmd.
 *
 *
 * Memberships/ACL:
 * Doesn't depend on user's membership.
 *
 *
 * Alerts:
 * no alerts available
 *
 */
function getRange($iLow, $iHigh, $iStep)
{
    $aResult = array();
    for ($i = $iLow; $i <= $iHigh && $iStep; $i += $iStep)
        $aResult[] = $i;
    return $aResult;
}

function getPeriod($sPeriod, $iLow, $iHigh)
{
    $aRes = array();
    $iStep = 1;
    $sErr = '';
   
    do
    {
        if (!$sPeriod)
        {
            $sErr = 'Variable sPeriod is emply';
            break;
        }
       
        $aParam = split('/', $sPeriod);
       
        if (count($aParam) > 2)
        {
            $sErr = 'Error of format for string assigning period';
            break;
        }
           
        if (count($aParam) == 2 && is_numeric($aParam[1]))
            $iStep = $aParam[1];
           
        $sPeriod = $aParam[0];
       
        if ($sPeriod != '*')
        {
            $aParam = split('-', $sPeriod);
           
            if (count($aParam) > 2)
            {
                $sErr = 'Error of format for string assigning period';
                break;
            }
           
            if (count($aParam) == 2)
                $aRes = getRange($aParam[0], $aParam[1], $iStep);
            else
                $aRes = split(',', $sPeriod);
        }
        else
            $aRes = getRange($iLow, $iHigh, $iStep);
    }
    while(false);
   
    if ($sErr)
    {
        // show error or add to log
    }
   
    return $aRes;
}

function checkCronJob($sPeriods)
{
    $aParam = split(' ', ereg_replace(" +", ' ', trim($sPeriods)));
    $bRes = true;
    $aDate = getdate(time());
   
    for ($i = 0; $i < count($aParam); $i++)
    {
        switch ($i)
        {
            case 0:
                $aRes = getPeriod($aParam[$i], 0, 59);
                $bRes = in_array($aDate['minutes'], $aRes);
                break;
            case 1:
                $aRes = getPeriod($aParam[$i], 0, 23);
                $bRes = in_array($aDate['hours'], $aRes);
                break;
            case 2:
                $aRes = getPeriod($aParam[$i], 1, 31);
                $bRes = in_array($aDate['mday'], $aRes);
                break;
            case 3:
                $aRes = getPeriod($aParam[$i], 1, 12);
                $bRes = in_array($aDate['mon'], $aRes);
                break;
            case 4:
                $aRes = getPeriod($aParam[$i], 0, 6);
                $bRes = in_array($aDate['wday'], $aRes);
                break;
        }
       
        if (!$bRes)
            break;
    }
   
    return $bRes;
}

function runJob($aJob)
{
    if(!empty($aJob['file']) && !empty($aJob['class']) && file_exists(BX_DIRECTORY_PATH_ROOT . $aJob['file'])) {
        if(!class_exists($aJob['class']))
            require_once(BX_DIRECTORY_PATH_ROOT . $aJob['file']);
       
        $oHandler = new $aJob['class']();
        $oHandler->processing();
    }
    else if(!empty($aJob['eval'])) {
        require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolService.php');
        eval($aJob['eval']);
    }
}

$oDb = new BxDolDb();

$aJobs = $oDb->fromCache('sys_cron_jobs', 'getAll', 'SELECT * FROM `sys_cron_jobs`');
foreach ($aJobs as $aRow)
{
    if (checkCronJob($aRow['time']))
        runJob($aRow);
}

?>

 

 

This is the whole file.

 

Many Thanks for your reply :)

Quote · 1 Dec 2009

 

does your periodic/cron.php file look like this:

<?php
/***************************************************************************
*                            Dolphin Smart Community Builder

 

Yes it does :)

Quote · 1 Dec 2009

and your crontab:

IE; **** usr/bin/php -q home/sites/lover/public_html/periodic/cron.php

where did you get the lines you posted? from and email...php version?

please edit above to simply say yes/

I have video tutorials to help you mrpowless.com
Quote · 1 Dec 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.