Skip to content

Instantly share code, notes, and snippets.

Last active December 30, 2020 21:50
What would you like to do?
ExifTool command line to cleanup picture folders
#!/usr/bin/env bash
set -e
set -u
export INPUT_DIR="${HOME}/Pictures/#sync/incoming"
export OUTPUT_DIR="${HOME}/Pictures/#sync/timestamps"
export REMOTE_DIR="${HOME}/Pictures/#sync/remote"
fdupes --recurse --noempty --nohidden --delete --noprompt ${INPUT_DIR}
# The last valid assignment supersedes the others
exiftool -progress -r -d "${OUTPUT_DIR}/%Y/%m/%Y%m%d%H%M%S%%-c.%%ue" "-filename<filemodifydate" "-filename<createdate" "-filename<datetimeoriginal" ${INPUT_DIR}
rsync -avzh --progress --stats --update ${OUTPUT_DIR} ${REMOTE_DIR}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment