Scheduled Game Save Backups with Ludusavi on Linux

Ludusavi is a cross-platform tool for backing up game saves and configuration. Currently, it does not have a built-in way to schedule backups, but we can use system tools to do so instead. In the post, we will use systemd user timers.

The following steps make a couple assumptions:

  1. You are running Linux and using systemd
  2. The ludusavi command is available at /usr/bin/ludusavi, which it is at least for the Arch Linux AUR package. You may need to adjust it when using another distribution or package.
  3. The timer is set to run daily, or 5-10 minutes after boot. You can adjust it if you want.

Steps

1. Set Ludusavi up in the GUI as you wish. Test with the Preview and Back Up buttons. 2. Create a service with systemctl edit --user --force --full ludusavi-backup.service and put the following text in it:

[Unit]
Description=Back up game saves
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/bin/ludusavi backup --force

[Install]
WantedBy=default.target

3. Create a timer with systemctl edit --user --force --full ludusavi-backup.timer and put the following text in it:

[Unit]
Description=Back up game saves
RefuseManualStart=no
RefuseManualStop=no

[Timer]
OnCalendar=daily
RandomizedDelaySec=5min
OnBootSec=5min

[Install]
WantedBy=timers.target

4. Enable the timer and run the backup with: systemctl --user enable --now ludusavi-backup.timer

Other Commands

Filed in: #linux