Created
June 17, 2020 06:15
-
-
Save kaihendry/b334fdcca1a1d2eb9927d226f65e7de3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
input=/mnt/sdcard/ | |
find $input -iname "*.jpg" | while read fn | |
do | |
if test $(exiv2 -Pv -g Xmp.xmp.Rating $fn) == 3 | |
then | |
dt=$(exiv2 -g Exif.Image.DateTime -Pv $fn) | |
read -r date time <<< "$dt" | |
IFS=: read -r year month day hour min secs <<< "$date" | |
IFS=: read -r hour min secs <<< "$time" | |
ymd=$(date -u -d "${year}-${month}-${day}T${hour}:${min}:${secs}" +%Y-%m-%d) | |
ssh [email protected] "test -d /mnt/red/redsamba/$ymd || mkdir /mnt/red/redsamba/$ymd" | |
echo rsync $fn [email protected]:/mnt/red/redsamba/$ymd/$(basename $fn) | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment