miku / metha

Command line OAI-PMH harvester and client with built-in cache.

Home Page:https://lab.ub.uni-leipzig.de/metha/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

metha-cat - can not open the "dir" extablished in .cache/metha

kuba112404 opened this issue · comments

Dear all, I have an issue with metha-cat / ls -la $(metha-sync -dir endpoint ( https://api.europeana.eu/oai/record)

Example:
ubuntu@harv01:~$ ls -la $(metha-sync -dir https://api.europeana.eu/oai/record)
ls: cannot access '/home/ubuntu/.cache/metha/I29haV9kYyNodHRwczovL2FwaS5ldXJvcGVhbmEuZXUvb2FpL3JlY29yZA': No such file or directory

ubuntu@harv01:~$ metha-cat -from 2018-01-01 https://api.europeana.eu/oai/record | xmllint --format -
FATA[0000] open /home/ubuntu/.cache/metha/I29haV9kYyNodHRwczovL2FwaS5ldXJvcGVhbmEuZXUvb2FpL3JlY29yZA: no such file or directory
-:1: parser error : Document is empty
I have installed xmllint

I have harvested data with
metha-sync -from 2018-08-01 -until 2018-09-30 -format edm https://api.europeana.eu/oai/record
xml-files in .cach/metha/I29haV9kYyNodHRwczovL2FwaS5ldXJvcGVhbmEuZXUvb2FpL3JlY29yZA
I can also read with $xmlint -format endpoint

Please advice, why the system can not recognize above mentioned directory - do I need additional permissions?
1537810 drwxr-xr-x 2 user user 12288 Aug 25 18:29 I2VkbSNodHRwczovL2FwaS5ldXJvcGVhbmEuZXUvb2FpL3JlY29yZA

Many thanks,
Kurt (kurt.baumann@switch.ch)

Thanks for giving metha a try!

One quirk of metha is that it does not keep state anywhere, except in the names of directories and files. In order to distinguish between data harvested in different formats, these will be stored in different directories.

$ basename $(metha-sync -dir https://api.europeana.eu/oai/record)
I29haV9kYyNodHRwczovL2FwaS5ldXJvcGVhbmEuZXUvb2FpL3JlY29yZA

$ basename $(metha-sync -dir -format edm https://api.europeana.eu/oai/record)
I2VkbSNodHRwczovL2FwaS5ldXJvcGVhbmEuZXUvb2FpL3JlY29yZA

Hence please supply -format for e.g. metha-cat as well.

PS. The directory name is just a base64 encoded string of set#format#endpoint e.g.

$ echo $(basename $(metha-sync -dir -format edm https://api.europeana.eu/oai/record)) | base64 -d
#edm#https://api.europeana.eu/oai/record

If this problem can be considered solved, I'll close this issue in a few days.