summaryrefslogtreecommitdiff
path: root/backuptogit.sh
diff options
context:
space:
mode:
Diffstat (limited to 'backuptogit.sh')
-rw-r--r--backuptogit.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/backuptogit.sh b/backuptogit.sh
new file mode 100644
index 0000000..47f3040
--- /dev/null
+++ b/backuptogit.sh
@@ -0,0 +1,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