-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdatemovdate
More file actions
executable file
·20 lines (19 loc) · 846 Bytes
/
updatemovdate
File metadata and controls
executable file
·20 lines (19 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# this script prepares all .mov files in the current directory for syncing with google photos
# it updates the exif, the last accessed date, and prepends the date
# this script is intended to process .mov files grabbed from imovie import
function updatemovdate {
for f in *.mov
do
if [ -f "$f" ]
then
echo processing $f
local FILECREATED=$(date -r $(stat -f %B "$f") +%Y%m%d%H%M.%S)
local FILENAMEPREPEND=$(date -r $(stat -f %B "$f") +%Y%m%d%H%M%S)
exiftool -overwrite_original "-createdate<creationdate" "-modifydate<creationdate" "-trackcreatedate<creationdate" "-trackmodifydate<creationdate" "-mediacreatedate<creationdate" "-mediamodifydate<creationdate" "$f"
touch -t $FILECREATED "$f" # last access and modify time
mv "$f" "${FILENAMEPREPEND}_$f"
fi
done
}
updatemovdate
echo "Done."