forked from github/server
use cadaver for box backups
This commit is contained in:
parent
4e99def119
commit
873086b75c
|
@ -4,6 +4,13 @@ if [ -z $ERESSEA ] ; then
|
||||||
echo "The ERESSEA environment variable is not set. Assuming $ERESSEA."
|
echo "The ERESSEA environment variable is not set. Assuming $ERESSEA."
|
||||||
fi
|
fi
|
||||||
GAME=$1
|
GAME=$1
|
||||||
|
|
||||||
|
upload() {
|
||||||
|
SRC="$1"
|
||||||
|
DST=$(basename "$SRC")
|
||||||
|
echo put "$SRC" "$DST" | cadaver "https://dav.box.com/dav/Eressea/game-$GAME/"
|
||||||
|
}
|
||||||
|
|
||||||
if [ ! -d $ERESSEA/game-$GAME ]; then
|
if [ ! -d $ERESSEA/game-$GAME ]; then
|
||||||
echo "No such game: game-$GAME."
|
echo "No such game: game-$GAME."
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -26,7 +33,7 @@ fi
|
||||||
if [ -e reports/reports.txt ] ; then
|
if [ -e reports/reports.txt ] ; then
|
||||||
echo "backup reports $TURN, game $GAME"
|
echo "backup reports $TURN, game $GAME"
|
||||||
tar cjf backup/$TURN-reports.tar.bz2 reports
|
tar cjf backup/$TURN-reports.tar.bz2 reports
|
||||||
curl -s -n -T backup/$TURN-reports.tar.bz2 https://dav.box.com/dav/Eressea/game-$GAME/$TURN-reports.tar.bz2
|
upload backup/$TURN-reports.tar.bz2
|
||||||
fi
|
fi
|
||||||
files="data/$TURN.dat parteien.full parteien"
|
files="data/$TURN.dat parteien.full parteien"
|
||||||
if [ -e orders.$TURN ]; then
|
if [ -e orders.$TURN ]; then
|
||||||
|
@ -34,5 +41,5 @@ files="$files orders.$TURN"
|
||||||
fi
|
fi
|
||||||
echo "backup turn $TURN, game $GAME, files: $files"
|
echo "backup turn $TURN, game $GAME, files: $files"
|
||||||
tar cjf backup/$TURN.tar.bz2 $files
|
tar cjf backup/$TURN.tar.bz2 $files
|
||||||
curl -s -n -T backup/$TURN.tar.bz2 https://dav.box.com/dav/Eressea/game-$GAME/$TURN.tar.bz2
|
upload backup/$TURN.tar.bz2
|
||||||
#curl -s -n -T eressea.db https://dav.box.com/dav/Eressea/eressea.db
|
|
||||||
|
|
Loading…
Reference in New Issue