Skip to content

Instantly share code, notes, and snippets.

@aquatix aquatix/
Last active Aug 29, 2015

What would you like to do?
Convert a directory with backup tarballs to a Git repository
if [ -z "$1" ]; then
echo "Missing source directory (dir with the tarballs)"
echo "usage:"
echo " <backupdir> <gitrepo>"
elif [ -z "$2" ]; then
echo "Missing git repository directory"
echo "usage:"
echo " <backupdir> <gitrepo>"
for FILE in `ls -1 $1`; do
#echo $FILE
echo "./$1/$FILE"
echo "$2/$FILE"
cp -a "$1/$FILE" $2
cd $2
tar xf "$FILE"
rm "$FILE"
git add -A
git commit -am "$FILE"
cd -
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.