fcsu, an extensible command-line utility for working with Fedora storage.
Why: Due to Fedora's current web service API design, it can be tedious and time-consuming to make certain kinds of changes to a repository. This utility works at a lower level (but not too low) in order to allow efficient batch modifications that are either impossible or impractical when going through the public API.
What's the catch:
fcsu is a very sharp tool and can be used to accidentally cause irreparable damage to your repository. It is always recommended that you test your changes against a backup copy rather than running modifications directly against your repository. In addition, certain types of changes you make with
fcsu can necessitate a SQL or Resource Index rebuild.
A Few Examples
Once you configure it to point to your repository's data (see
conf/config.properties), you can do things like the following. Note that by default there are two stores defined, 'legacy' and 'akubra', but you can define any number of them by adding a configuration file similar to the ones already found in
Migrate from Fedora legacy storage to akubra-fs: (this can also be used to migrate from one akubra-based impl to another)
List all objects whose pids match a given regular expression:
For all objects, migrate DC, RELS-EXT, and RELS-INT datastreams from inline XML to managed content:
For all objects in the hdl namespace, re-compute the size and sha1 checksum of all managed and inline datastreams, even if it's already defined:
Make a complete copy of the repository but omit all AUDIT datastreams:
Want to Try It?
You can download the latest test build here. The
fcsu shell script can be found in the
bin directory after unpacking. Note: It should work in Windows, but the .bat file isn't written for that yet.
Any questions or comments? Let me know here or via email. Thanks!