Skip to content

Instantly share code, notes, and snippets.

@TimSoethout
TimSoethout / sync.sh
Last active February 21, 2016 18:10 — forked from wernerb/sync.sh
Sync folder with Google Drive. Recursively downloads with wget and Google Drive public links. Used to sync ebooks to my eReaders (Kobo). Be warned that public links are dangerous as they could allow someone to download your files. Be sure to use this only in secure environments. This has been tested to be used in POSIX shells as well as in bash.
#!/bin/sh
set -x
#input sharelink here. Example: https://drive.google.com/folderview?id=0B1g-MbiD2F6vdtOT92b3MoerO&usp=sharing
# SHARELINK="https://drive.google.com/folderview?id=idU&usp=sharing"
SHARELINK="https://drive.google.com/folderview?id=0B8HjeRxyzNm7RjZIdDFVWHkxeXM&usp=sharing"
DESTINATION="/mnt/onboard/gdrive"
# Change following to false when you don't want to delete files when they are missing from google drive. This can