All checks were successful
Run nix flake check / flake-check (push) Successful in 1m45s
30 lines
878 B
Bash
30 lines
878 B
Bash
#!/usr/bin/env bash
|
|
|
|
SAVE_DIR="/home/torjus/.local/share/Steam/steamapps/compatdata/881100/pfx/drive_c/users/steamuser/AppData/LocalLow/Nolla_Games_Noita"
|
|
|
|
RESTIC_REPOSITORY="/home/$(whoami)/tmp/noita-backup"
|
|
export RESTIC_REPOSITORY
|
|
export RESTIC_PASSWORD="noita"
|
|
|
|
echo "Doing initial backup"
|
|
restic backup -q "$SAVE_DIR"
|
|
echo "Backup done"
|
|
|
|
echo "Mounting tmpfs for save folder..."
|
|
sudo mount -o size=2G,noswap -t tmpfs none "$SAVE_DIR"
|
|
|
|
echo "Restoring initial backup..."
|
|
restic restore "latest:$SAVE_DIR" --target "$SAVE_DIR"
|
|
|
|
echo "Ready to play Noita!"
|
|
echo "Remember to unmount the tmpfs after playing:"
|
|
echo ""
|
|
echo "restic -r $RESTIC_REPOSITORY backup -q $SAVE_DIR && sudo umount $SAVE_DIR && restic -r $RESTIC_REPOSITORY restore latest:$SAVE_DIR --target $SAVE_DIR"
|
|
|
|
while true
|
|
do
|
|
restic backup -q "$SAVE_DIR"
|
|
echo "Periodic backup done..."
|
|
sleep 10m
|
|
done
|