Created
November 18, 2015 19:30
-
-
Save michaelmcmillan/269c544091ad6f01083f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Google Drive client | |
DRIVE=/usr/local/bin/drive | |
# What to backup on local disk. | |
backup_files="/Users/michaelmcmillan/Prosjekter" | |
# Where to backup to in Google Drive. | |
dest="xxxxxxxxx" | |
# Create archive filename. | |
day=$(date +%Y-%m-%d:%H:%M) | |
hostname=$(hostname -s) | |
archive_file="$hostname-$day.tgz" | |
# Backup the files using tar and piping it to Google Drive. | |
tar czfP - $backup_files | $DRIVE upload --stdin --title $archive_file --parent $dest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment