Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Datestamped backup of git repositories managed by gitosis
#A script to backup all the git repositories managed by gitosis
#and create a date stamped tarball.
#Pradeep Gowda
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
You can’t perform that action at this time.