You are here:  » import_slow cron


import_slow cron

Submitted by Halion on Thu, 2012-05-10 11:20 in

Hi everyone, I'm having a problem setting up an import_slow cron job. I want cron.php to fetch the file set up in automation job and import it using the import_slow method.

I have no trouble setting up a cron.php (option1) so that it fetches and imports smaller files.

With larger files I need to use import_slow.

I assume cron.php uses the regular import method and not import_slow. Is this correct? Is there a way to amend cron.php so it imports using import_slow.php?

I've set up 2 cron jobs, 1 to fetch (works ok) and a import_slow cron to run half an hour later, but cannot get import_slow to work. I've tried all the permutations of command line I've found in the forum. I'm running 12/10B with admin password.

eg: /usr/bin/wget --max-redirect=9999 http://www.example.com/scripts/import_slow.php?password=PASSWORD&filename=@ALL

Could you help as I'm stuck!

Submitted by support on Thu, 2012-05-10 11:48

Hi Halion, and welcome to the forum!

Sure, it would be possible to combine the fetch functionality with the import slow method but it would be best to establish why slow import isn't being invoked using the above. The first thing I would like to suggest would be to redirect the output to a file in the /feeds/ folder so that any error or warning output from the wget command can be checked. To do this, modify your CRON job as follows:

/usr/bin/wget --max-redirect=9999 http://www.example.com/scripts/import_slow.php?password=PASSWORD&filename=@ALL > /path/to/example.com/feeds/cron.txt

(if you're not sure of /path/to/example.com/ it's the Install Path value displayed on the Support Info page)

With that in place, schedule the command to run and after the scheduled time, check the cron.txt which may indicate the problem - let me know what is displayed if you're not sure.

It is possible however that wget is not available, so curl could be used as an alternative (if installed). The equivalent command would be:

/usr/bin/curl -L http://www.example.com/scripts/import_slow.php?password=PASSWORD&filename=@ALL

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Halion on Thu, 2012-05-10 12:46

Hi David, and thanks for the quick reply. I have tried both options.

The first option, feeds/cron.txt results in a blank txt file of 0 bytes.

The second using curl appears to execute but without importing anything.

Is there anything else I can try?

Submitted by support on Thu, 2012-05-10 13:09

Hi,

That does sounds like maybe wget isn't installed then; could you try the same with curl to send the output to cron.txt e.g.

/usr/bin/curl -L http://www.example.com/scripts/import_slow.php?password=PASSWORD&filename=@ALL > /path/to/example.com/feeds/cron.txt

Cheers,
David.
--
PriceTapestry.com

Submitted by Halion on Thu, 2012-05-10 15:27

The result is a blank cron.txt file in the feeds folder.

The message I'm getting from the cron email is :

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed

0 70 0 70 0 0 106 0 --:--:-- --:--:-- --:--:-- 106
0 70 0 70 0 0 106 0 --:--:-- --:--:-- --:--:-- 0
Usage: import_slow.php?filename=[filename|@MODIFIED|@ALL]&password=...

I've spent hours on this including reinstalling and still come up against this block. The fetch cron shows up fine in the modified section of the admin page, but I cant find the right command to invoke import_slow to import the file.

Any thoughts?

Submitted by Halion on Thu, 2012-05-10 17:33

I seem to have made some progress by using the command:

/usr/bin/curl -L --max-redirs 9999 -o /dev/null "http://www.example.com/scripts/import_slow.php?filename=FEEDNAME&password=PASSWORD"

This appears to be importing_slow ok, by checking in phpmyadmin I can see the products table fill up. However, after importing is completed, on the admin page it's showing 0 products, and 0 products on the Site summary, which is a bit disconcerting.

Any idea why this might be? Thanks for your help.

Submitted by support on Fri, 2012-05-11 06:35

Hello Halion,

Sorry about that this has revealed a bug and error in process in the scriptable version of the slow import tool scripts/import_slow.php in the 12/10B distribution.

I have corrected this in the distribution if you could download and just extract scripts/import_slow.php and upload to your current installation it should then work as expected; apologies for the inconvenience.

Cheers,
David.
--
PriceTapestry.com

Submitted by Halion on Fri, 2012-05-11 16:45

Thanks for the great help David, Preliminary results are that the database appeared to get corrupted after around 35 mins of import_slow by cron, which was not so good, but this could be due to a variety of factors, so I'll post later when I've checked this out more.