Created
February 2, 2019 10:53
-
-
Save mingodad/072617c698017a743f19673d211b8045 to your computer and use it in GitHub Desktop.
Create a git repository from a set of backup files
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
#!/bin/bash | |
#expect an ordered list of backup files in bkpList.txt | |
#for an example dowload indent backup files with "wget -nc -i bkpListSrc.txt" | |
bkp_ext=".tar.gz" | |
git_folder=src | |
if [[ ! -e $git_folder ]] | |
then | |
mkdir $git_folder | |
git init $git_folder | |
cd $git_folder | |
git config diff.renames copies | |
cd .. | |
fi | |
bkp_list=(`cat bkpList.txt`) | |
bkp_list_len=${#bkp_list[*]} | |
bkp_list_last_idx=$(( ${bkp_list_len} - 1 )) | |
echo $bkp_list_len $bkp_list_last_idx | |
for (( i=0; i < $bkp_list_len; ++i)) | |
do | |
#echo $i ${bkp_list[$i]} | |
bkp_folder=${bkp_list[$i]} | |
echo $bkp_folder | |
tar xzf $bkp_folder$bkp_ext | |
cd $bkp_folder | |
ln -s ../$git_folder/.git .git | |
git add -u . | |
git add . | |
git commit -m "backup $bkp_folder" | |
cd .. | |
if [[ $i != $bkp_list_last_idx ]] | |
then | |
#echo $i $bkp_list_last_idx | |
rm -f -r $bkp_folder | |
fi | |
done |
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
indent-1.9.1 | |
indent-1.10.0 | |
indent-2.1.0 | |
indent-2.1.1 | |
indent-2.2.0 | |
indent-2.2.1 | |
indent-2.2.2 | |
indent-2.2.3 | |
indent-2.2.4 | |
indent-2.2.5 | |
indent-2.2.6 | |
indent-2.2.7 | |
indent-2.2.8 | |
indent-2.2.9 | |
indent-2.2.10 | |
indent-2.2.11 | |
indent-2.2.12 |
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
https://ftp.rediris.es/mirror/GNU/indent/indent-1.10.0.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-1.9.1.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.1.0.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.1.1.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.2.0.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.2.1.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.2.10.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.2.11.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.2.12.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.2.2.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.2.3.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.2.4.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.2.5.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.2.6.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.2.7.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.2.8.tar.gz | |
https://ftp.rediris.es/mirror/GNU/indent/indent-2.2.9.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment