You are a runner, cyclist or triathlete? You love Golden Cheetah? You track your activities with Garmin devices? You want to download all of them from Garmin Connect? You want to archive, cloud-backup and import automatically into Golden Cheetah? Alright, where´s the problem?!? Rise a feature request and ask for new Golden Cheetah functionality! But exactly this is easier said than done:

1) Garmin charges an expensive one-time administrative fee to cover their extensive engineering and server support they require for running the Connect program.
2) Golden Cheetah is an open source application and there might be no chance of any payment to Garmin for its use at all.
3) As Garmin does also not offer alternatives the chances for a new Golden Cheetah feature are really low.

But there are tons of alternatives and workarounds. Here is mine.

Download, archive, backup, auto-import!

Apple claims writing a shell script is like riding a bike: „You fall off and scrape your knees a lot at first. With a bit more experience, you become comfortable riding them around…“ Awesome! For the rest I totally agree. „Shell scripting is perfect for creating small pieces of code that connect other tools together.“

Tooling

Before we are diving into details some insights on my tooling: Mac user, running their latest OSX. Additional to that my preferred cloud storage is Google Drive. The latter would not make any difference to a Dropbox, Box.com or another typical cloud storage.

What the rest does

The following section explains in detail what the rest of the script does. But first: You don´t have to adjust anything else there. Everything got already configured with setting the parameters.

Downloads activities from Garmin Connect

Cleans json as not used and required for backup

Opens GoldenCheetah finally

Request user input if a backup shall be taken

Waits for answer

Kills GoldenCheetah if still open

Starts backup section

Grabs Date und Year

Keeps history of most recent 5 backups

Zips entire athleteslibrary folder and backups on daily basis

Archives exported activities

Checks and creates Year Folder

Moves previous files to archive

Run it

Seems your browser does not like HTML 5 videos, but don’t worry, you can download it and watch it with your favorite video player!

Running the script is easy. There are various ways. Very old school with a simple terminal command: „sh sport.sh“. Or make sure that Python is installed and just double-click your *.sh.

How to recover a backup

Golden Cheetah athlete library.

The most important folder is your athlete directory. Everything in there gets „backuped“ and can easily get recovered with overwriting a newly created athlete:

Download, unzip, install and open GoldenCheetah.

Create a new athlete.

Change athlete directory.

Close GoldenCheetah.

Open GoldenCheetah again. Just to be on the safe side.

Unzip latest ZIP from your backups.

Replace new athlete folder with your Backup.

Open Golden Cheetah.

Backup recovered.

DISCLAIMER

No Guarantee

This script does NOT guarantee to get all your data or even download it correctly. Against my Garmin Connect account it works quite fine and smooth, but different Garmin Connect account settings or different data types could potentially cause problems.

Garmin Connect API

This is NOT an official feature of Garmin Connect, Garmin may very well make changes to their APIs that breaks this script (and they certainly did since this project got created for several times).

Golden Cheetah

This is NOT an official feature of Golden Cheetah, Golden Cheetah may very well make changes that breaks this script.

THIS SCRIPT IS FOR PERSONAL USE ONLY

It simulates a standard user session (i.e., in the browser), logging in using cookies and an authorization ticket. This makes the script pretty brittle. If you’re looking for a more reliable option, particularly if you wish to use this for some production service, Garmin does offer a paid API service.

Security Disclaimer

The way as the shell script is described has litte to no change of running securely. Passwords are stored plain in the script itself. It definitely has a lot of room for improvements. My intention is to keep it as simple and pragmatic for you. That is the basis to adjust it according your personal paranoia level. The most secure way would be to type it in every time you run the script.

License

Feedback

Contributions

Contributions are warmly welcome, particularly if this script stops working with Garmin Connect. You may consider opening a GitHub issue first. New features, however simple, are encouraged. Other than that, thx for using this script.