mattwilson1024 / google-photos-exif

A tool to populate missing `DateTimeOriginal` EXIF metadata in Google Photos takeout, using Google's JSON metadata.
MIT License
882 stars 130 forks source link

Merging directories from several takeout files #35

Closed redstreet closed 1 year ago

redstreet commented 1 year ago

Thanks a ton for making, sharing, and importantly, documenting this, this is terrific!

EDIT: see the post below, unzip -d is the easier way to go.

Just wanted to share this for other users in the same boat as me: if you need to merge directories from several .zip or .tgz takeout files, a good way to do so is this:

# assumes you have extracted each takeout zip file into one directory. Then:
mkdir MASTER
rsync -a takeout-202303XXXX-001/ MASTER/ --ignore-existing --remove-source-files -v
rsync -a takeout-202303XXXX-002/ MASTER/ --ignore-existing --remove-source-files -v
...
find . -type d -empty -delete

Duplicate files may exist in MASTER if you had albums. You can remove them using fdupes or :

find . -type f | sed 's#.*/##' | sort | uniq -c | sort -n
rachitpant commented 1 year ago

You could simply go into the terminal and run unzip '*.zip' -d combined

redstreet commented 1 year ago

That's much simpler and good to know. Edited my post.