-
-
Save gadiener/34b36ca45d0eb1470dcab356ff9cc9c0 to your computer and use it in GitHub Desktop.
Backup all Repositories in current directory
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/bash | |
for i in $(find . -type d -maxdepth 1 -mindepth 1); do | |
echo "Backup $i..." | |
zip_name="$i-$(date +'%y%m%d').zip" | |
pushd "$i" && \ | |
git archive --format=zip --output="/opt/backups/$zip_name" master && \ | |
popd | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment