Skip to content

Instantly share code, notes, and snippets.

@micheleorsi
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micheleorsi/1fcf6f2d0c66558f5834 to your computer and use it in GitHub Desktop.
Save micheleorsi/1fcf6f2d0c66558f5834 to your computer and use it in GitHub Desktop.
Make a zip, upload to Google Cloud Storage every couple of days
# every couple of days at 2PM run git repo backup
0 14 */2 * * /home/git/runBackup.sh
#!/bin/bash
now=`date +"%Y%m%d"`
echo "zipping to backup$now"
zip -r backup$now.zip repositories
/home/git/google-cloud-sdk/bin/gsutil cp backup*.zip gs://<bucket-name> # WARN: modify this line!
rm backup*.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment