Added run alias and some random bash scripts

This commit is contained in:
Random936
2025-09-30 19:48:54 -07:00
commit cd69ef9e7d
7 changed files with 63 additions and 0 deletions

7
tld/cleanup.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
ROOT="$HOME/backup_tld"
for save in $(find . -mindepth 1 -maxdepth 1 -type d | cut -d '/' -f 2 | sort -n | head -n -3); do
rm -rf "$ROOT/$save"
done

13
tld/restore.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
if [[ $# < 1 ]]; then
echo "Please provide save name (eg. sandbox2)"
exit
fi
ROOT="$HOME/backup_tld"
latest=$(find $ROOT -mindepth 1 -maxdepth 1 -type d | rev | cut -d '/' -f 1 | rev | sort -nr | head -n 1)
echo "Restoring save $latest/$1"
cp "$ROOT/$latest/$1" "$HOME/.local/share/Hinterland/TheLongDark/Survival/"

5
tld/save.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
backup=$(date +%s)
mkdir "$HOME/backup_tld/$backup"
cp -R "$HOME/.local/share/Hinterland/TheLongDark/Survival/"* "$HOME/backup_tld/$backup"