Created
March 15, 2015 22:49
-
-
Save renatomefi/2b662e6acb0162edf6ab to your computer and use it in GitHub Desktop.
Simple script to update your git mirrors, with different ssh keys and paths
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
#!/usr/bin/ssh-agent bash | |
# Script for updating git mirror repositories | |
# $1 repository | |
# $2 ssh key | |
echo "$(date +'%F %H:%M:%S') Start updating the mirror repository: " $1 | |
ssh-add $2 | |
echo "Key added: " $2 | |
git --git-dir=$1 remote update | |
echo "$(date +'%F %H:%M:%S') Updating end --------" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Want to automatically update your repos evey minute?
Add it to crontab: