From 9aa7fb2f87f1449be6bf81907c9f939a620442ad Mon Sep 17 00:00:00 2001 From: Philipp Klaus Date: Tue, 7 Jun 2011 11:19:09 +0200 Subject: [PATCH] Erste, funktionierende Version des Backups. --- .gitignore | 3 +++ Makefile | 2 ++ backup.sh | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100755 backup.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8e299d6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +studienfuehrer-* +dumpgenerator.py +.DS_Store diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ce48871 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +all: + ./backup.sh > studienfuehrer-last-backup.log diff --git a/backup.sh b/backup.sh new file mode 100755 index 0000000..76bd455 --- /dev/null +++ b/backup.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# ### About this script +# Dieses Script dient dem Zweck, die Inhalte des Studienführers Physik der ZaPF zu sichern. +# Die Internetseite des Studienführers ist . +# Dazu wird ein Skript des Projekts wikiteam genutzt, das automatisch alle Inhalte sichert. +# +# ### Author +# Philipp Klaus +# +# ### Links / Quellen +# * How to backup without access to the wiki server: + +## zum debuggen diese Zeile einkommentieren: +#set -x + +## ----- Konfiguration: +BASE_URL="https://www.fs-maphy.uni-hannover.de" +#EXPORT_URL=$BASE_URL"/w/index.php5?title=Spezial:Exportieren" +API_URL=$BASE_URL"/w/api.php" +BACKUP_FOLDER="studienfuehrer-$(date +%Y-%m-%d)" +DUMPGENERATOR_TOOL_URL="http://wikiteam.googlecode.com/svn/trunk/dumpgenerator.py" +DUMPGENERATOR_TOOL="dumpgenerator.py" + +## ----- Befehle: +#svn checkout http://wikiteam.googlecode.com/svn/trunk/ wikiteam +#wget $DUMGENERATOR_TOOL_URL +curl -C - -O $DUMPGENERATOR_TOOL_URL +## Hier passiert die eigentliche Arbeit, das Backup des Wikis: +python $DUMPGENERATOR_TOOL --api=$API_URL --xml --images --logs --path=$BACKUP_FOLDER +tar czvf $BACKUP_FOLDER.tar.gz $BACKUP_FOLDER/* +## Nach dem erstellen der gepackten Datei können wir den Ordner löschen: +rm -rf $BACKUP_FOLDER