Skip to content

Commit

Permalink
Adds setup script and environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
WisdomWolf committed Nov 8, 2022
1 parent fa0f54c commit 0bf1117
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
17 changes: 17 additions & 0 deletions init-steam-backup-vars.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

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 $STEAM_SAVES_DIR
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 "BIN_DIR = $BIN_DIR"
12 changes: 8 additions & 4 deletions my-steam-backup.sh
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`)
$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
17 changes: 17 additions & 0 deletions steam-backup-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
SCRIPT_DIR=$(dirname `readlink -f $0`)
$SCRIPT_DIR/init-steam-backup-vars.sh

mkdir $BIN_DIR
cd $HOME/bin
wget https://github.com/mtkennerly/ludusavi/releases/download/v0.10.0/ludusavi-v0.10.0-linux.zip
unzip ludusavi-v0.10.0-linux.zip
rm ludusavi-v0.10.0-linux.zip

git clone $STEAM_BKUPER_REPO $STEAM_BKUPER_DIR

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
cd $STEAM_SAVES_DIR
git remote add origin-new $STEAM_SAVES_REPO

0 comments on commit 0bf1117

Please sign in to comment.