This small script downloads gpx files from Garmin using garmin-connect-export, and saves them in a directory. When you run it again, it will only download new gpx files.
/root
|-/Walking
| |-/<yyyy-mm-dd>_<activity name>.gpx
| |-/<yyyy-mm-dd>_<activity name>.gpx
| |-/<yyyy-mm-dd>_<activity name>.gpx
|
|-/Cycling
| |-/<yyyy-mm-dd>_<activity name>.gpx
| |-/etc...
|
|-/etc...
<activity name>
is whatever the activity is called in the Garmin cloud, typically the location and activity, e.g. amsterdam-walking
.
Run this script every week using cron to keep an offline copy of the gpx files.
First, download garmin-connect-export. Then, make a settings.json
file, following the example given in settings.json.example
:
- The
gce_location
option needs the path to the directory you downloadedgarmin-connect-export
to, either relative to your working directory or absolute. username
andpassword
are your credentials for Garmin.maxdownloads
is the maximum number of activitiesgarmin-connect-export
can download, you can probably just set this to a very high number, but it may be good to first test your settings with a small number.gpxtrack_folder
is the directory your gpx files will be synced to.- By default, this script will scan the existing files to get the Garmin ID of each gpx file. This ID is used to determine whether a file should be downloaded. By setting
use_persistent_garminidlist
toTrue
, you can change the behaviour and make use of the list of ids (location set bypersistent_garminids
option) this script outputs after every run. This is faster because we don't scan all files every run, but it requires you to keep this list of ids around, which can be annoying.
Next, just run python gcesync
(with settings in the working directory) to sync giles.