A universal background tool for automated game save backups and rotation.
This Node.js script acts as a wrapper for your games. It launches the game, automatically creates timestamped backups of your save file at defined intervals, and safely cleans up old backups to save disk space. Once you exit the game, the script stops automatically.
- Automated Backups: Periodically backs up a target save file while the game process is running.
- Auto-Rotation: Keeps only the latest
Nbackups and deletes older ones. - Process Binding: Automatically starts the game and stops itself when the game is closed.
- Interactive Restore: Includes a CLI utility to easily roll back to previous save states.
- Zero Dependencies: Uses only built-in Node.js modules.
- Node.js (v20.6.0 or newer is required for native
.envfile loading).
-
Clone the repository:
git clone git@github.com:ondrejbase/save-scummer.git cd save-scummer -
Create your configuration file by copying the provided template:
cp config.env.example config.env
-
Open the newly created
config.envfile in a text editor and adjust the variables to match your specific setup:GAME_EXECUTABLE="devilutionx" SOURCE_PATH="~/.local/share/diasurgical/devilution/single_0.sv" BACKUP_DIR="~/Games/Diablo/saves-backup" BACKUP_INTERVAL_MS=180000 MAX_BACKUPS=20
Run the script via Node:
node index.jsThe script will launch the game defined in GAME_EXECUTABLE, monitor the SOURCE_PATH, and begin the backup loop.
If you need to roll back to a previous save state, ensure the game is fully closed first to prevent file access conflicts or data corruption.
Using the Interactive Restore Tool: Run the included restore script from your terminal:
node restore.jsThe script will read your config.env, display a list of all available backups sorted by date, and prompt you to choose which one to restore. It will automatically copy the chosen backup over your current save file.
Manual Restore:
Alternatively, you can manually navigate to your BACKUP_DIR, locate the desired timestamped file, and copy it over the file located at your SOURCE_PATH.
This project is open-source and available under the MIT License.