blob: 47f30408c83cb689d250c65cdc8b0357ce917223 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/bin/sh
BACKUPDIR=/tmp/advbackup
OUTGIT=/tmp/luaatcgit
SCRIPTPTH=$(dirname `realpath $0`)
mkdir -p $OUTGIT
cd $OUTGIT
git init
git config user.name "autocommitter"
git config user.email "autocommitter@linux-forks.de"
for f in $BACKUPDIR/*.tar.gz
do
d=`echo $f | sed -E 's/.*\/([0-9]+-[0-9]+-[0-9]+).*/\1/g'`
mkdir -p /tmp/world
cd /tmp/world
tar xzf $f
find . -type f -name "advtrains_*" -exec mv -i {} . \;
lua $SCRIPTPTH/gitexporter.lua /tmp/world/ $OUTGIT
cd $OUTGIT
git add .
git commit -m "State at $d"
rm -r /tmp/world
done
|