Skip to content

Instantly share code, notes, and snippets.

@Loupax
Last active October 26, 2025 14:14
Show Gist options
  • Select an option

  • Save Loupax/fb0599f5af70b29d4120b0fb8c4fd4b3 to your computer and use it in GitHub Desktop.

Select an option

Save Loupax/fb0599f5af70b29d4120b0fb8c4fd4b3 to your computer and use it in GitHub Desktop.
Automatic backups of my Dark Souls save files

Create the timer and service files inside your ~/.config/systemd/user folder and the ds_backup inside the ~/bin folder

Run systemctl --user daemon-reload

If everything works as intended, this timer will automatically create backups of your saves, even in Gaming Mode.

[Unit]
Description=Dark Souls Save Backup Service
[Service]
Type=oneshot
ExecStart=/home/deck/bin/ds_backup
[Unit]
Description=Run ds-backup.service every 5 minutes
[Timer]
OnUnitActiveSec=5min
OnBootSec=1min
[Install]
WantedBy=timers.target
#!/bin/bash
# 1. The FULL path to your save file directory
SAVE_FILE_DIR="/home/deck/.local/share/Steam/steamapps/compatdata/570940/pfx/drive_c/users/steamuser/Documents/NBGI/DARK SOULS REMASTERED/"
# 2. Where you want to store your backups
BACKUP_DIR="/home/deck/Documents/DS_Backups/"
# Create the backup directory if it doesn't exist
mkdir -p "$BACKUP_DIR"
# Check if the game process is running
if ps -aux | grep "[D]arkSoulsRemastered.exe" > /dev/null
then
# Game is running. Create a timestamped backup.
TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S)
zip -r "$BACKUP_DIR/ds_backup_$TIMESTAMP.zip" "$SAVE_FILE_DIR"
# Delete everything except the 15 most recent backups
ls -1t "$BACKUP_DIR/*.zip" | tail -n +15 | xargs -r rm
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment