Skip to content

Commit

Permalink
Merge pull request #1 from WisdomWolf/main
Browse files Browse the repository at this point in the history
Add WisdomWolf's improvements from his fork
  • Loading branch information
AngeIo authored Jan 13, 2024
2 parents fa0f54c + 935f6ba commit 48bbaf7
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
22 changes: 22 additions & 0 deletions init-steam-backup-vars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -e

if [ -f "$HOME/steam-backup.env" ];then
export $(grep -v '^#' ~/steam-backup.env | xargs)
fi

export STEAM_BKUPER_DIR="${STEAM_BKUPER_DIR:-$HOME/.local/share/steam-bkuper}"
export STEAM_SAVES_DIR="${STEAM_SAVES_DIR:-$HOME/.local/share/steam-saves}"
export STEAM_BKUPER_REPO="${STEAM_BKUPER_REPO:-'https://github.com/AngeIo/steam-bkuper'}"
export STEAM_SAVES_REPO="${STEAM_SAVES_REPO:?}"
export BIN_DIR="$HOME/bin"

mkdir -p $BIN_DIR

# Uncomment for debugging
# echo "STEAM_BKUPER_DIR = $STEAM_BKUPER_DIR"
# echo "STEAM_SAVES_DIR = $STEAM_SAVES_DIR"
# echo "STEAM_BKUPER_REPO = $STEAM_BKUPER_REPO"
# echo "STEAM_SAVES_REPO = $STEAM_SAVES_REPO"
# echo "STEAM_SAVES_REPO2 = $STEAM_SAVES_REPO2"
# echo "BIN_DIR = $BIN_DIR"
12 changes: 8 additions & 4 deletions my-steam-backup.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/sh
cd /home/deck/Documents/gitrepo/steam-saves
/home/deck/Documents/bin/ludusavi backup --force --path /home/deck/Documents/gitrepo/steam-saves/ludusavi-backup
LD_PRELOAD="/usr/lib/libcurl.so.4" /home/deck/Documents/bin/git-sync -s -n
#!/usr/bin/env bash

SCRIPT_DIR=$(dirname `readlink -f $0`)
source $SCRIPT_DIR/init-steam-backup-vars.sh

cd $STEAM_SAVES_DIR
$BIN_DIR/ludusavi backup --force --path $STEAM_SAVES_DIR/ludusavi-backup
LD_PRELOAD="/usr/lib/libcurl.so.4" $BIN_DIR/git-sync -s -n

## For logs, type this in Launch Options :
# %command% ; /home/deck/Documents/bin/my-steam-backup.sh > /tmp/$(date +'%F_%H.%M.%S').testlog ; ping github.com -c 2 > /tmp/$(date +'%F_%H.%M.%S').testping
Expand Down
26 changes: 26 additions & 0 deletions steam-backup-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -e
SCRIPT_DIR=$(dirname `readlink -f $0`)
source $SCRIPT_DIR/init-steam-backup-vars.sh

cd $BIN_DIR
wget -qc https://github.com/mtkennerly/ludusavi/releases/download/v0.10.0/ludusavi-v0.10.0-linux.zip -O ludusavi-v0.10.0-linux.zip
unzip -oq ludusavi-v0.10.0-linux.zip
rm ludusavi-v0.10.0-linux.zip

if [ ! -d "$STEAM_BKUPER_DIR" ]; then
git clone $STEAM_BKUPER_REPO $STEAM_BKUPER_DIR
fi

cp $STEAM_BKUPER_DIR/{my-steam-backup.sh,git-sync,init-steam-backup-vars.sh} $BIN_DIR
chmod -R 755 $BIN_DIR
# rm -rf $STEAM_BKUPER_DIR

if [ ! -d "$STEAM_SAVES_DIR" ]; then
git clone $STEAM_SAVES_REPO $STEAM_SAVES_DIR
fi

cd $STEAM_SAVES_DIR
if [ -n "$STEAM_SAVES_REPO2" ]; then
git remote add origin-new $STEAM_SAVES_REPO2
fi

0 comments on commit 48bbaf7

Please sign in to comment.