LibraryOfCongress / bagger

The Bagger application packages data files according to the BagIt specification.
Other
120 stars 19 forks source link

Feature Request: Create Multiple Bags in Place at once #73

Open BWDouglas opened 4 months ago

BWDouglas commented 4 months ago

Hello! I am currently working on a project with hundreds of folders that need to be bagged individually. With the current workflow, this will take a very long time. Would it be possible to add a function to select a master folder and have it bag all subfolders individually? Or do you have any suggestion for how to automate this process?

OS: Mac OS 14.4

jscancella commented 4 months ago

If you are looking to automate, you probably should use https://github.com/LibraryOfCongress/bagit-python The bottleneck making a bag faster will be how long it takes to read the files off disk.

But something like this should do it, in your terminal:

cd <master folder>
for f in `ls`; do bagit.py --sha256 <master folder>/$f; done