mik icon indicating copy to clipboard operation
mik copied to clipboard

Postwritehook suggestion: reorganize output by filetype?

Open bondjimbond opened this issue 6 years ago • 3 comments

Use case: I'm running CONTENTdm migrations right now, and just ran into an issue where, of a 619-item image collection, 614 are JPGs and 5 are JP2s. I failed to notice the JP2s, and attempted to ingest the whole set as Basic Images, which of course meant that the five JP2s were not ingested.

In migrations where the source collection contains a mix of content models, it would be helpful to create subdirectories in the output directory, so that objects with different filetypes were appropriately grouped. Should be doable with a post-write hook, I think?

e.g. Right now, my images are all poured into the directory herbarium_output. With the proposed post-write hook, the JPGs would get written to herbarium_output/jpg and the JP2s would go to herbarium_output/jp2.

bondjimbond avatar Sep 05 '18 19:09 bondjimbond

This might do the trick: https://github.com/MarcusBarnes/mik/blob/master/extras/scripts/postwritehooks/move_packages_by_extension.php

I just used it in our Summit migration, it was very useful.

mjordan avatar Sep 05 '18 20:09 mjordan

Ah, so it already exists! Awesome, thanks. Will give it a try.

bondjimbond avatar Sep 06 '18 14:09 bondjimbond

@bondjimbond did this work for you? If so, can you close this issue?

mjordan avatar Oct 04 '18 03:10 mjordan