Created
March 28, 2010 05:15
-
-
Save eddyxu/346589 to your computer and use it in GitHub Desktop.
backup git repos
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/sh | |
TIMESTAMP=`date +"%F"` | |
SRC_PATH="/base/src/path" | |
TAR_PATH="/target/path" | |
if [ ! -d $TAR_PATH ]; then | |
mkdir -p $TAR_PATH | |
fi | |
tar -cjf $TAR_PATH/git-$TIMESTAMP.tar.bz -C $SRC_PATH git | |
find $TAR_PATH -ctime 30 -type f -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment