Ajout du script de backup des repos.
Modification de cgit pour une lecture des repos à l'exterieur
This commit is contained in:
parent
7eb49b267b
commit
760b2cd08a
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +1,6 @@
|
||||
[submodule "nargv"]
|
||||
path = nargv
|
||||
url = https://github.com/hypersoft/nargv
|
||||
[submodule "cgit"]
|
||||
path = cgit
|
||||
url = https://git.zx2c4.com/cgit
|
||||
|
||||
1
cgit
Submodule
1
cgit
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit e2e71777189800ad5e31c49f080d42ac3b792610
|
||||
44
git-backup.sh
Normal file
44
git-backup.sh
Normal file
@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
REPOS=/srv/git/
|
||||
TSTMP=`date '+%s'`
|
||||
BUNDLESTMP="/tmp/bundles/$TSTMP"
|
||||
OUTPUTDIR=/root/git-backup
|
||||
trt()
|
||||
{
|
||||
for fl in `find * -maxdepth 0 -type d ! -name bundles`
|
||||
do
|
||||
cd $fl
|
||||
echo "Traitons $1$fl"
|
||||
if git rev-parse --is-bare-repository >/dev/null 2>&1
|
||||
then
|
||||
git bundle create "$BUNDLESTMP/$1$fl.bundle" --all
|
||||
else
|
||||
mkdir "$BUNDLESTMP/$1$fl"
|
||||
trt "$1$fl/"
|
||||
fi
|
||||
cd ..
|
||||
done
|
||||
}
|
||||
|
||||
mkdir -p "$BUNDLESTMP/"
|
||||
|
||||
for fld in mysaa bernard
|
||||
do
|
||||
mkdir "$BUNDLESTMP/$fld"
|
||||
cd "$REPOS/$fld/"
|
||||
trt "$fld/"
|
||||
done
|
||||
|
||||
mdate=`date "+%yw%U"`
|
||||
fletter="a"
|
||||
while [ -f "$OUTPUTDIR/git-pipi2-$mdate$fletter.tar.gz" ]
|
||||
do
|
||||
if [ ${fletter: -1} == "z" ]
|
||||
then fletter="${fletter}a"
|
||||
else fletter="${fletter::-1}$(echo ${fletter: -1} | tr '0-9a-z' '1-9a-z_')"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Enregistrement sous git-pipi2-$mdate$fletter.tar.gz"
|
||||
tar -czvf "$OUTPUTDIR/git-pipi2-$mdate$fletter.tar.gz" $BUNDLESTMP
|
||||
rm -r $BUNDLESTMP
|
||||
Loading…
x
Reference in New Issue
Block a user