Skip to content

Commit

Permalink
onedrive backup (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
ennorehling committed Apr 7, 2024
1 parent 96bbeef commit 992e9ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions process/backup-onedrive
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ fi
GAME=$1

upload() {
onedrive-cli cp "./$1" "Eressea/game-$GAME"
echo "uploading $1"
onedrive-cli cp "./$1" "Eressea/game-$GAME/"
}

if [ ! -d "$ERESSEA/game-$GAME" ]; then
Expand Down Expand Up @@ -35,10 +36,8 @@ if [ -e "orders.$TURN" ]; then
fi
echo "backup turn $TURN, game $GAME, files: ${files[*]}"
tar cjf "backup/$TURN.tar.bz2" "${files[@]}"
if [ -e reports/reports.txt ] ; then
upload "backup/$TURN.tar.bz2"
echo "backup reports $TURN, game $GAME"
tar cjf "backup/$TURN-reports.tar.bz2" reports eressea.db
upload "backup/$TURN-reports.tar.bz2"
fi
upload "backup/$TURN.tar.bz2"
echo "backup reports $TURN, game $GAME"
tar cjf "backup/$TURN-reports.tar.bz2" reports eressea.db
upload "backup/$TURN-reports.tar.bz2"

2 changes: 1 addition & 1 deletion process/cron/run-eressea.cron
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GAME=$1
backup()
{
if [ -x "$BIN/backup-eressea" ] ; then
"$BIN/backup-eressea" "$1" "$2"
"$BIN/backup-eressea" "$@"
fi
}

Expand Down

0 comments on commit 992e9ac

Please sign in to comment.