mik
mik copied to clipboard
Postwritehook suggestion: reorganize output by filetype?
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
.
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.
Ah, so it already exists! Awesome, thanks. Will give it a try.
@bondjimbond did this work for you? If so, can you close this issue?