Skip to content

Instantly share code, notes, and snippets.

@AndiH
Created July 7, 2014 19:34
Show Gist options
  • Select an option

  • Save AndiH/4dc6230b63750ac4f57b to your computer and use it in GitHub Desktop.

Select an option

Save AndiH/4dc6230b63750ac4f57b to your computer and use it in GitHub Desktop.
Small script for backing up a folder with rsync (to local Dropbox) and gsync (to Google Drive)
#!/usr/bin/env bash
# Backups the local version of my PhD thesis to Dropbox and Google Drive
# Andreas Herten, 2014
main() {
local baseDir="/Users/Andi/Documents/Studium/Promotion/Thesis/LaTeX"
local logFile="thesis.log"
local gDriveTargetDir="Thesis/Backup/"
local gDriveLogfile=$baseDir/"gsync."$logFile
local dropboxTargetDir="/Users/Andi/Dropbox/Promotion/Thesis"
local dropboxLogfile=$baseDir/"rsync."$logFile
gsync \
-rlptgov --progress --stats --human-readable --delete --cvs-exclude \
--log-file=$gDriveLogfile \
$baseDir \
drive://$gDriveTargetDir
rsync -az -v --progress --stats --human-readable --delete \
--log-file=$dropboxLogfile \
$baseDir \
$dropboxTargetDir
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment