Does anyone have a working CRON script for this? I had one, but it just quit working. And I can't for the life of me remember where it came from.
Here's my Cron:
cd "/home/fakedir/public_html/fakeadmin/" php -f ./rcs_cron.php -- rcs_cron=1
Using fakedir and fakeadmin to be safe, but I assure you, the paths are correct.
Here is the script I have in the admin folder:
Code:
<?php
/** RECOVER CART SALES -- AUTOMATED SCRIPT FOR CRON PROCESSING
*
* Proper use:
* -----------
* php -f ./rcs_cron.php -- rcs-cron=1 [tdate=x]
*
* where [tdate=x] is an optional parameter, with x being the number of days (history) you wish to process for.
*
* NOTE: it's expected that you will run this script from inside the admin folder.
* (ie: chdir to admin folder, then run this script)
*/
// process command-line vars into GET vars:
if ($argc > 0) {
for ($i=1; $i<$argc; $i++) {
$it = split("=", $argv[$i]);
$_GET[$it[0]] = $it[1];
}
}
// Check whether has been started with required parameters:
if (!isset($_GET['rcs_cron'])) {
echo "\n Recover Cart Sales (RCS) \n Automated processing script\n ===========================\n Proper use:\n -----------\n php -f ./rcs_cron.php -- rcs-cron=1 [tdate=x]\n\n where [tdate=x] is an optional parameter, with x being the number of days (history) you wish to process for.\n NOTE: it's expected that you will run this script from inside the admin folder.\n\n\n";
exit();
}
// set some prerequisites:
define('RCS_CRON_USERID', 100);
$tdate = (isset($_GET['tdate'])) ? $_GET['tdate'] : '';
// load the Zen Cart core:
require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . FILENAME_MAIL . '.php');
require(DIR_WS_LANGUAGES . $_SESSION['language'] . '/recover_cart_sales.php');
require(DIR_WS_CLASSES . 'currencies.php');
$currencies = new currencies();
// begin RCS processing:
echo 'RCS processing for date range: past ' . ($tdate != '' ? $tdate : RCS_BASE_DAYS) . ' days.' . "\n";
doUnattendedRCS($tdate);
echo 'Finished.' . "\n\n";
I also found this bit of code in my fakeadmin/includes/init_includes/overrides/init_admin_auth.php and don't know if it is what is causing the prob:
Code:
if (!isset($_SESSION['admin_id']) && $_GET['rcs_cron'] == 1 && defined('RCS_CRON_USERID')) {
$_SESSION['admin_id'] = RCS_CRON_USERID;
$bypass_additional_auth = true;
}
Bookmarks