This script is designed to backup all Steam game save files to git automatically (optimized for Steam Deck).
I played a lot on my Steam Deck. One day, I left my console charging all night and when I wanted to get back in game, the OS refused to boot and I was stuck on BIOS. The SSD decided to stop working. I was a bit worried at first, but then I realised that my game saves should be safe in the Steam Cloud.
But, of course, I was wrong.
Why? Because some games do not provide Steam Cloud, like Just Cause 3.
This script has been specially made to ensure that those who use it NEVER EVER lose their precious game saves in such cases.
- Easy to install with a single command
- Use Git for backup versioning
- While game is starting and/or when game is closed, do a backup
- "Launch Options" are automatically set on all games of your Steam library
- While setting new launch options, show/extract a list of existing ones or different from
STEAM_LOPTSvalue so the user can merge them manually
Important
(The following information is probably outdated) You must be on the Beta version of SteamOS 3.5.7 (as of 01/19/24 - OS Build: 20231122.1) for the latest version of ludusavi (v0.22.0) to work.
If you don't want to switch to SteamOS Beta, you could downgrade to ludusavi v0.19.0 (latest version working on Stable) by modifying LUDUSAVI_VER in .env.
- Tested on Arch Linux (6.14.4-arch1-1) as of 04/29/25, SteamOS 3.5.7 Beta and Ubuntu 22.04.3 but could be working on other distros
- Git
If you want to easily access your Steam Deck from your main computer, follow these steps:
You have to create a password before you can access your console with SSH.
First, switch to Desktop Mode, then open the terminal called Konsole.
Type this command to define your new password:
passwd
Now start SSH service and type your password:
sudo systemctl start sshd
Enable the SSH service so it stays up even after a reboot of the Steam Deck (make it accessible while in Game Mode too!):
sudo systemctl enable sshd
For more information, you can check this FAQ from Valve: https://help.steampowered.com/en/faqs/view/671A-4453-E8D2-323C
Clone the repository:
git clone https://github.com/AngeIo/steam-bkuper
cd steam-bkuper
You have to edit the variables to make sure everything installs in the correct paths and the script behaves the way you want, here's how:
- Rename
.env.templateto.env. - Create a new repository on GitLab, GitHub, or both with the name of your choice, in my example, this repo is called
steam-saves. Then, copy your 2 URLs respectively inSTEAM_SAVES_REPOandSTEAM_SAVES_REPO2variables (or onlySTEAM_SAVES_REPOif you have one). - (Optional) Find your
AccountID/Friend Codeand put it inSTEAM_ACCOUNTID(get it from https://steamcommunity.com/id/YOUR_USERNAME/friends/add or https://steamdb.info/calculator/) - Modify all other variables in
.envto match with your environment.
Here are examples of behaviour you can apply by modifying the STEAM_LOPTS variable in .env so "Launch Options" are set automatically:
%command%;/path/to/script/my-steam-backup.sh
/path/to/script/my-steam-backup.sh;%command%
/path/to/script/my-steam-backup.sh;%command%;/path/to/script/my-steam-backup.sh
Warning
All your Launch Options will be overwritten by the following script!
But don't worry, you can always rollback:
A copy of localconfig.vdf is created and the script gives you a command to easily restore it back!
Once you are satisfied with your variables in the .env file, you can launch the installation:
chmod +x ./steam-backup-setup.sh
./steam-backup-setup.sh
To allow the git repositories to push content to remote in the background while in "Game Mode", you must enter these commands the first time:
# Git will store your credentials so you don't have to type them next time
git config --global credential.helper store
Then run $BIN_DIR/my-steam-backup.sh from your terminal so you are asked to type your git login and password for each repositories once to store them:
chmod +x /path/to/script/my-steam-backup.sh
/path/to/script/my-steam-backup.sh
You are now ready to backup your whole Steam library!
Warning
One last thing!
If you want to disable backups for a specific game somehow (mainly because saves takes too much space and a single file exceeds the 100MB limit on GitHub and GitLab, cc Hytale), do the following:
You must type the command ludusavi
On the GUI, untick the unwanted game(s) so it is added to the configuration file.
Or, if you know what you are doing, you can directly edit the config file with vi `ludusavi config path` like so:
[...]
backup:
path: /home/agerard/ludusavi-backup
ignoredGames:
- Hytale
filter:
excludeStoreScreenshots: false
[...]
That's it! Next time you'll run the script, it will skip the chosen game(s)!
To make sure everything is working:
- Start a game with Launch Options configured
- Close it
- (Yes, it's that simple)
Check your remote Git repository (GitHub, GitLab, etc.), if the directory $STEAM_SAVES_DIR/ludusavi-backup is populated with your save files then congratulations!
Caution
If you use multiple computers at the same time (for example, your Steam Deck and desktop PC) with this program, git conflicts can and will happen!!
Please make sure, once in a while, that your saves are still pushed to the remote repository.
If somebody with enough git knowledge wants to help, you are more than welcome to create a pull request, thanks! :)
You are now safe from any defects your Steam Deck/PC may encounter!
Here is what your directories should look like in STEAM_SAVES_DIR:
(deck@asundeck steam-saves)$ tree
.
├── ludusavi-backup
│ ├── Alien_ Isolation
│ │ ├── drive-0
│ │ │ └── home
│ │ │ └── deck
│ │ └── mapping.yaml
[...]
│ └── Uno (2016)
│ ├── drive-0
│ │ └── home
│ │ └── deck
│ └── mapping.yaml
├── README.md
└── typescript
XX directories, XX files
(deck@asundeck steam-saves)$
Here's how you can restore your backups:
- Launch
ludusavi, a nice GUI should open. - Click on
Restore Mode. - In
Restore fromchoose theludusavi-backupdirectory inside your personal git repository:STEAM_SAVES_DIR(contains your save files). - Click on
Preview, the list of backed up games should appear. - Select the games you want to restore by ticking them.
- Click on
Restore. - Enjoy!
I know this script is far from perfect, please create pull requests if you want to help me improve it. Thanks!
- Matthew Kennerly and contributors for
ludusavi - Simon Thum and contributors for
git-sync - Ryan Beaman for his contributions from his personal public fork
- frostworx for his script to set Steam launch options on all games automatically
- Angelo