Skip to content

Instantly share code, notes, and snippets.

Last active December 24, 2022 19:16
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Backup local Steam Deck save files via ludusavi and rclone
# /usr/lib/systemd/system/backup-saves.service
Description=Run ludusavi then rsync to offsite backup
ExecStart=bash /home/deck/
# /usr/lib/systemd/system/backup-saves.timer
Description=Backup saves scheduling
#!/usr/bin/env bash
# sudo systemctl enable backup-saves.timer
# sudo systemctl start backup-saves.timer
# get latest version
newest=$(curl -sL | jq -r '.[0].name' | tr -d "v")
# get installed version
current=$(ludusavi --version | awk '{print $NF}')
# download latest release
if (( $(echo "$newest" "$current" | awk '{if ($1 > $2) print 1;}') )); then
echo "Downloading newest release: $newest"
url=$(curl -sS -H "Accept: application/vnd.github.v3+json" | jq .assets[1].browser_download_url | xargs)
cd /tmp && curl -LJO "$url"
unzip "/tmp/ludusavi-v${newest}"
chmod +x /tmp/ludusavi
mv /tmp/ludusavi /usr/local/bin/
rm "/tmp/ludusavi-v${newest}"
echo "Newest version is already installed: $current"
# backup save files
# # * See `~/.config/ludusavi/config.yaml`
echo "Backing up saves"
ludusavi backup --force >/dev/null 2>&1
# upload to google drive
# # * See `~/.config/rclone/rclone.conf`
echo "Syncing to Google Drive"
rclone sync --fast-list /home/deck/ludusavi_backup drive:Backup/steam/deck
[[ $? = 0 ]] && echo "Successfully backed up to Google drive!"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment