Created
August 19, 2011 15:44
-
-
Save btbytes/1157115 to your computer and use it in GitHub Desktop.
Datestamped backup of git repositories managed by gitosis
This file contains hidden or 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/bash | |
#A script to backup all the git repositories managed by gitosis | |
#and create a date stamped tarball. | |
#Pradeep Gowda | |
#2011-08-19 | |
GITOSISADMIN=$HOME/mycompany/gitosis-admin | |
GITSERVER="[email protected]" | |
TODAY=`date +%Y-%m-%d` | |
mkdir gitbackups-$TODAY | |
grep ^writable $GITOSISADMIN/gitosis.conf | cut -d= -f 2 | tr "\\n" " " | tr " " "\\n" | sort | uniq | xargs -I {} git clone $GITSERVER:{}.git gitbackups-$TODAY/{} | |
tar czf gitbackups-$TODAY.tgz gitbackups-$TODAY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment