This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Extensions » Doing immediate sqliimport in admin
expandshrink

Doing immediate sqliimport in admin

Doing immediate sqliimport in admin

Thursday 22 December 2011 4:39:04 pm - 6 replies

Hi,

I'm trying to use the sqliimport immediate import in admin tab, but when I choose my import handler and click the button, the screen shows the list of imports, in first place my import with status 'Pending (Cancel)' and Progress '(0%)'.

Have I to activate something into the extension?

Thanks

Regards

Thursday 22 December 2011 10:31:22 pm

Hi Alex,

yes, you need to have cronjobs provided by SQLImport extension in your crontab configuration for immediate imports to work.

Friday 23 December 2011 1:52:04 pm

Thanks for the answer.

But I don't understand, where can I see an example?

Regards

Friday 23 December 2011 2:21:08 pm

Hi Alex,

you need to add something like this to your crontab:

# This must be set to the directory where eZ Publish is installed.
EZPUBLISHROOT=/path/to/the/ez/publish/directory
 
# Location of the PHP Command Line Interface binary.
PHP=/usr/local/bin/php
 
*/5 * * * * cd $EZPUBLISHROOT && $PHP runcronjobs.php -q sqliimport_run 2>&1

This will make sure that cronjob that processes immediate imports will run every 5 minutes, so immediate will not be exactly imediate, but with a slight delay.

Friday 23 December 2011 2:53:24 pm

Ok I will test it, but my idea was to run an import at the moment not every x minutes.

Thanks and Merry Christmas!

Friday 23 December 2011 3:02:47 pm

Hello Folks!

 

When I read forum thread like this I truly wish that other wrote as extensive usage documentation as we at BC do for our public extensions (in most cases).

I really think that the above question, answer and example usage absolutely should be clearly covered within the text documentation which is distributed with every copy of the extension (packaged or otherwise). If it's not this is a serious problem for the users of this extension.

Detailed documentation of an extension's usage is vital to effective use of said extension and does prevent needless (yet repeating) public inqueries of FAQ like questions.

 

Though I note now that even our examples do not cover the subject of crontab usage (as this can very depending on the OS used). Though I tend to think that while some basics should be covered, others like usage of another app (crontab) which is already very well publicly documented may not be ...

Some may think that the usage of the runcronjobs script and cronjob parts are well known by eZ Publish users and developers, but this is not always the case in practice.

 

I hope this helps ...

 

Cheers,

Heath

Friday 23 December 2011 3:18:16 pm

Ok I will test it, but my idea was to run an import at the moment not every x minutes.

Thanks and Merry Christmas!

Setting up the cronjob that runs every x minutes does not mean that your import will run every x minutes, but that there will be a delay running the import for at least x minutes. Cronjob will run every x minutes to see if it has anything to process and then quit if there's nothing.

In SQLIImport, immediate import is a one-time import only, in contrast to scheduled (repetitive) imports. So cronjob will, the next time it runs, see your request for immediate import, run it and then forget about it. It will not be ran again. However, as I sad, there will be a delay of maximum x minutes in running the immediate import, it will not be run at the exact same moment you request it.

Crontab's lowest resolution is one minute, so you can at least set it up to run every minute, not every 5 minutes. "*/5" in the above example is what tells crontab to run every 5 minutes. Change it to */1 and you will have a maximum delay of 1 minute in running the import.

Merry Christmas to you to happy.gif Emoticon

Modified on Friday 23 December 2011 3:24:24 pm by Edi Modrić

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from