Every photo you take has a date set in the file by the camera in what is called exif metadata. Some cameras can also record the exact coordinates where the photo was taken ... anyway, I needed to fix those dates. I also like to keep the files in a
So, here is my script:
#!/bin/sh
DATE=`exiftool "$1" | grep 'Create Date' | sed -e 's/.*: //;s/://g;s/..$//;s/ //g'`
DEST=`echo $DATE | sed 's@^\(....\)\(..\)\(..\).*@/media/shared/Pictures/\1/\2/\3/@'`
if [ -d "$DEST" ]; then
else
cp -an "$1" "$DEST"
fi
Aucun commentaire:
Enregistrer un commentaire