A Google Photos backup tool.
gitmoo-goog
tool uses Google Photos API to continuously download all photos on a local device.
It can be used as a daemon to keep in sync with a google-photos account.
Download:
Unzip and run, there are no other dependencies.
(There is more than one way to do the following):
- Go to API
- Click on
Enable the Google Photos API
button - Create a new project, name it whatever you like.
- Write
gitmoo-goog
in theproduct name
field, (can be whatever you like) - On the
when are you calling from
, chooseOther
, clickCreate
. - Download the client configuration.
- Copy the downloaded
credentials.json
to the same folder withgitmoo-goog
. - run
gitmoo-goog
, and follow the provided link: - Sign in, and click
Allow
- Copy the
token
and paste it in the cli. gitmoo-goog
will authorize and start downloading content.
$ ./gitmoo-goog
2018/09/12 10:18:07 This is gitmoo-goog ver 0.1
Go to the following link in your browser then type the authorization code:
https://accounts.google.com/o/oauth2/auth?access_type=...
4/WACqgFeX5OTB8X4LWd5i2TFH....
Saving credential file to: token.json
2018/09/12 10:20:07 Connecting ...
2018/09/12 10:20:07 Processed: 0, Downloaded: 0, Errors: 0, Total Size: 0 B, Waiting 5s
This is probably not what you want, hit crt-c
to stop it.
Usage of ./gitmoo-goog:
-folder string
backup folder
-force
ignore errors, and force working
-logfile string
log to this file
-loop
loops forever (use as daemon)
-max int
max items to download (default 2147483647)
-throttle int
Time, in seconds, to wait between API calls (default 5)
On Linux, running the following is a good practice:
./gitmoo-goog -folder archive -logfile gitmoo.log -loop -throttle 45 &
This will start the process in background, making an API call every 45 seconds, looping forever on all items and saving them to {pwd}/archive
.
Logfile will be saved as gitmoo.log
.
Files are created as follows:
[folder][year][month][day]_[hash].json
and .jpg
. The json
file holds the metadata from google-photos
.