-
Notifications
You must be signed in to change notification settings - Fork 10
Cookbook: Removing .Thumbs.db and other operating system files from ingest packages generated with MIK
MIK comes with a script (extras/scripts/remove_files.php) that can be run on a directory to delete all files with specific names. You might want to do this because some operating systems create files that may creep into ingest packages during file copy operations or other common tasks. Two examples are '.Thumbs.db' on Windows and '.DS_Store' on OS X.
To remove these two files from a directory containing a batch of Islandora ingest packages, run the remove_files.php script on the directory immediately prior to ingesting the packages:
php remove_files.php -d=/target/directory -l=/path/to/log/file
The -d
option is required since it identifies the directory to scan. The -l
(for 'log') option is not required. If you include it, a message for each file the script deletes, or attempts to delete but can't due to permissions problems, is written to the specified file; if you don't include it, messages are printed to STDOUT.
If you know the names of other files you want the script to delete, add them to the $files_to_remove
array near the top of the script.
If you're on Windows and prefer to use a PowerShell or cmd command to remove .Thumbs.db files, see this cookbook entry.
Content on the Move to Islandora Kit wiki is licensed under a Creative Commons Attribution 4.0 International License.