https://github.com/wimmuskee/shell-oaiharvester
OAI-PMH harvester in shell.
https://github.com/wimmuskee/shell-oaiharvester
bash command-line-tool oai-harvester oai-pmh
Last synced: 5 months ago
JSON representation
OAI-PMH harvester in shell.
- Host: GitHub
- URL: https://github.com/wimmuskee/shell-oaiharvester
- Owner: wimmuskee
- License: gpl-3.0
- Created: 2012-01-23T06:55:05.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2025-12-23T07:45:35.000Z (6 months ago)
- Last Synced: 2025-12-24T22:14:34.707Z (6 months ago)
- Topics: bash, command-line-tool, oai-harvester, oai-pmh
- Language: Shell
- Homepage:
- Size: 146 KB
- Stars: 17
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: COPYING
Awesome Lists containing this project
README
# Shell OAI Harvester
The OAI-PMH Shell Harvester is able to harvest OAI-PMH targets. It supports multiple configurable targets which can be updated individually. Furthermore, it is able to execute a preset command for each record it updates or deletes.
View the [CHANGELOG](CHANGELOG.md) for important changes.
## Installation
Use sudo/root where needed.
### Dependencies
- bash
- curl
- coreutils (cat, cut, head, date, printf, test)
- grep
- sed
- xmllint (optional for validating responses)
- xsltproc (libxslt)
### Manual
- git clone https://github.com/wimmuskee/shell-oaiharvester.git
- cd shell-oaiharvester
- cp oaiharvester /usr/bin/oaiharvester
- mkdir /usr/share/shell-oaiharvester
- cp libs/* /usr/share/shell-oaiharvester/.
- mkdir /etc/shell-oaiharvester
- cp config.example.xml /etc/shell-oaiharvester/config.xml
### Make
- git clone https://github.com/wimmuskee/shell-oaiharvester.git
- cd shell-oaiharvester
- autoreconf -i
- ./configure
- make
- make install
### Gentoo
Package available in the flavour overlay.
## Usage
### Configuration
The harvester has several configuration options that apply to the general behaviour while other options are repository specific.
Different config files can be used with different levels of precedence (without fallback).
1. commandline option provided location: `oaiharvester -c `
2. *$HOME/.config/shell-oaiharvester/config.xml*
3. */etc/shell-oaiharvester/config.xml*
Some notes on the options:
- deletecmd: executed before a record is deleted, optional
- updatecmd: executed after a record is updated, optional
- ${identifier} holds the identifier
- ${filename) is the identifier with optional xz extension
- ${path} holds the absolute path of the record
- ${responsedatetime} the full oai page responsedate
- ${responsedate} the YYYY-MM-DD format of responsedatetime
- repository update and delete cmd's are executed before the generic ones if available
- set, from, until, conditional and recordpath are optional
### Operation
View all available options:
```oaiharvester -h```
To harvest records from a specified repository, run:
```oaiharvester -r ```
To only retrieve identifiers:
```oaiharvester -r -n```
Not harvest, but validate the repository
```oaiharvester -r -t```
To perform strict validation use:
```oaiharvester -r --test-strict```
To list configured repositories:
```oaiharvester -l```
### Logs
Unless customized, the log file of the harvest process is stored at */tmp/oaiharvester-log.csv*. The logger uses a simple csv format with a line for each downloaded page:
```YYYY-MM-DD HH:MM:SS,PID,repository,record count,download time,process time```.
A recordlog can also be set, by default at */dev/null* because depending on repositories this file can increase in size a lot. This has the following format:
```YYYY-MM-DD HH:MM:SS,repository,record datestamp,record identifier```.
### Status
Once harvested, each repository directory will hold a status file. In version 1, this is *lasttimestamp.txt* containing just the timestamp where the harvester should continue.
Starting from version 2, a hidden *.oaiharvester* file is used to contain not only the timestamp, but also harvester version information which should help with future migrations.