Created
May 3, 2021 17:24
-
-
Save pas-calc/e23827f653fd6e52a62a68fc9a73b990 to your computer and use it in GitHub Desktop.
Import Photos from external device (camera, mobile phone). Create directory structure based on year-month
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Import von X2-02 | |
# 17APR2015, bilder->images 22FEB2017, delete empty dirs 14APR2020 | |
echo "Importing Photos..." | |
folder="/media/pascal/microSD 2GB/Images" # Bilder | |
echo "change to dir: \"${folder}\"" | |
cd "$folder" 2>/dev/null | |
res=$? | |
if [ "$res" == "0" ] ; then | |
echo "directory ok" #pwd | |
exiftool "-Directory<DateTimeOriginal" -d "/home/pascal/Bilder/Fotos/Handy Nokia X2-02/%Y-%m" . | |
else | |
echo "failed" | |
fi | |
echo "Delete empty dirs" | |
find . -maxdepth 1 -type d -empty -delete -print | |
echo "" | |
read -t 5 -p "$(tput setaf 7)Press [Enter] key (or wait 5 secs) ...$(tput sgr0)" | |
exit $res | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment