Skip to content

Instantly share code, notes, and snippets.

@mrowe
Last active May 7, 2017 22:13
Show Gist options
  • Save mrowe/056a57898c2ca43ecea2f0c56f8e4add to your computer and use it in GitHub Desktop.
Save mrowe/056a57898c2ca43ecea2f0c56f8e4add to your computer and use it in GitHub Desktop.
Restore my Garmin Edge 510 from a local backup
#!/bin/bash
set -e
DISK="disk2"
VOLUME="GARMIN"
BACKUP="${HOME}/Desktop/Garmin"
FILELIST="Sports/*.fit Settings/Settings.fit Device.fit"
diskutil eraseDisk MS-DOS ${VOLUME} MBR /dev/${DISK}
mkdir -p "/Volumes/${VOLUME}/Garmin/NewFiles"
for f in ${FILELIST} ; do
cp ${BACKUP}/$f /Volumes/${VOLUME}/Garmin/NewFiles/
done
diskutil eject /dev/${DISK}
echo 'Good luck!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment