EPrints Technical Mailing List Archive

Message: #03840


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: CLI Import


Thanks for the reply, Adam.

I've since discovered 3.3 import has the plugin arguments in it. So that answers that bit.

What I want to achieve is to have a directory that someone can put files into and then I can have a cron job which imports whatever is in the directory on a regular basis.

What I'm doing with the import is:

   - I have a directory that someone will FTP data into
   - I have a bash script which looks to see if anything is there and calls import on each item there
   - if the import succeeds I delete/move aside the item so I don't consider it next time.
   - the bash script gets called on a regular basis so that things that get deposited in the FTP directory will get imported.

So I need to be able test if the import worked or not (so I know to move/delete). Whatever I return from the plugin seems to get hidden by the import command which seems to always succeed. So at the moment, I am writing a result code to a file in /tmp as part of the plugin and checking that which is a bit clunky!

Hope that all makes sense.

Thanks,

Ray.


________________________________________
From: eprints-tech-bounces@ecs.soton.ac.uk <eprints-tech-bounces@ecs.soton.ac.uk> on behalf of Field A.N. <af05v@ecs.soton.ac.uk>
Sent: 23 January 2015 13:51
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: CLI Import

Hi Ray

        As to point 1, you are correct.  This is not supported in 3.2.2 (I downloaded it and checked the script).  Point 2 is believable.  I think you may be using the import script in a way that wasn't envisaged.

        Perhaps you could let us know what you're trying to achieve, and we could suggest alternative routes to getting it sorted out.  I tend to control large imports from perl scripts using the API directly rather than from bash scripts.

--
Adam Field
Business Relationship Manager and Community Lead
EPrints Services




On 22 Jan 2015, at 16:09, CARRICK Ray wrote:

> Hi folks,
>
> I have created a import plugin which uses the eprints/bin/import command
>
> http://wiki.eprints.org/w/API:bin/import
>
> and have 2 problems with it.
>
> 1. in the doc it says you can pass arguments to the plugin by
>
>           --argument key=value
>
> this doesn't seem to be implemented in version EPrints 3.2.2 (Chocolate Cake)
>
> 2. the return value of the plugin seems to get hidden by the import command. If I test the return value of the import command in a shell script it seems to return success no matter what.
>
> Is there any other way to pass in parameters to the plugin and any way to get the success/failure of the plugin back out.
>
> Any thoughts appreciated.
>
> Thanks,
>
> Ray.
>
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: http://www.eprints.org/tech.php/
> *** EPrints community wiki: http://wiki.eprints.org/
> *** EPrints developers Forum: http://forum.eprints.org/


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.