This is share svg Share this item


Google Photos and Albums backup with Google Photos Library API (CLI)

For a very good description and detailed instructions see Logix's Article at Linux Uprising

Google Photos Sync downloads your Google Photos to the local file system. It will backup all the photos the user uploaded to Google Photos, but also the album information and additional Google Photos 'Creations' (animations, panoramas, movies, effects and collages).

It is only for Google Photos download / backup purposes. It cannot upload photos to Google Photos.

This project uses the new Google Photos API see

After doing a full sync you will have 2 directories off of the specified root:

photos - contains all photos and videos from your Google Photos Library organized into folders with the structure 'photos/YYYY/MM' where 'YYYY/MM' is the date the photo/video was taken. The filenames within a folder will be as per the original upload except that duplicate names will have a suffix ' (n)' where n is the duplicate number of the file (this matches the approach used in the official Google tool for Windows).
albums - contains a folder hierarchy representing the set of albums and shared albums in your library. All the files are symlinks to content in the photos folder. The folder names will be 'albums/YYYY/MM Original Album Name'.
In addition there will be further folders when using the --compare-folder option. The option is used to make a comparison of the contents of your library with a local folder such as a previous backup. The comparison does not require that the files are arranged in the same folders, it uses meta-data in the files such as create date and exif UID to match pairs of items. The additional folders after a comparison will be:

comparison a new folder off of the specified root containing the following:
missing_files - contains symlinks to the files in the comparison folder that were not found in the Google Photos Library. The folder structure is the same as that in the comparison folder. These are the files that you would upload to Google Photos via the Web interface to restore from backup.
extra_files - contains symlinks into to the files in photos folder which appear in the Library but not in the comparison folder. The folder structure is the same as the photos folder.
duplicates - contains symlinks to any duplicate files found in the comparison folder. This is a flat structure and the symlink filenames have a numeric prefix to make them unique and group the duplicates together.

usage: gphotos-sync [-h] [--album ALBUM] [--log-level LOG_LEVEL]
[--logfile LOGFILE] [--compare-folder COMPARE_FOLDER]
[--favourites-only] [--flush-index] [--rescan]
[--retry-download] [--skip-video] [--skip-shared-albums]
[--album-date-by-first-photo] [--start-date START_DATE]
[--end-date END_DATE] [--db-path DB_PATH]
[--albums-path ALBUMS_PATH] [--photos-path PHOTOS_PATH]
[--use-flat-path] [--omit-album-date] [--new-token]
[--index-only] [--skip-index] [--do-delete] [--skip-files]
[--skip-albums] [--use-hardlinks] [--no-album-index]
[--case-insensitive-fs] [--max-retries MAX_RETRIES]
[--max-threads MAX_THREADS] [--secret SECRET] [--archived]
[--progress] [--max-filename MAX_FILENAME] [--ntfs]

Contact the Author