You are here:  » Cron (import.php and Fetch.php)


Cron (import.php and Fetch.php)

Submitted by babyuniverse on Wed, 2016-05-25 00:37 in

Hi David,

I have been using cron.php successfully for a long time, one of the sites seems to time out when using it and only half the feeds get updated and imported.

The command I was running was
cd /home/xxxxxxx/public_html/scripts;/usr/bin/php cron.php running at midnight each night.

I have tried to split this into 2 jobs as follows
cd /home/xxxxxxx/public_html/scripts;/usr/bin/php fetch.php @ALL
cd /home/xxxxxxx/public_html/scripts;/usr/bin/php import.php @MODIFIED

However the cron results in a message saying

--------------------------------------------------------------
X-Powered-By: PHP/5.6.21
Content-type: text/html; charset=UTF-8

Usage: import.php |@ALL|@MODIFIED [limit]
--------------------------------------------------------------
X-Powered-By: PHP/5.6.21
Content-type: text/html; charset=UTF-8

Usage: fetch.php |@ALL

---------------------------------------------------------------

Any ideas?

Thanks
Richard

Submitted by support on Wed, 2016-05-25 08:43

Hello Richard,

That looks like some kind of PHP internal issue with the command line version in that it does not appear to be passing the command line parameters to the script. What you can do however is simply default to @ALL instead.

For scripts/fetch.php look for the following code at line 14:

  if ($argc < 2)
  {
    print "Usage: fetch.php <filename>|@ALL\n"; exit;
  }

...and REPLACE with:

  if ($argc < 2)
  {
    $argv[1] = "@ALL";
  }

And in scripts/import.php look for the following code at line 16:

  if ($argc < 2)
  {
    print "Usage: import.php <filename>|@ALL|@MODIFIED [limit]\n"; exit;
  }

...and REPLACE with:

  if ($argc < 2)
  {
    $argv[1] = "@ALL";
  }

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by babyuniverse on Thu, 2016-05-26 04:00

thanks, that seemed to do the job