Automating backups on a system that suspends due to inactivity

I’m using Debian 13 whose repository has version 45.2 of deja-dup. My first thought was to use the flatpak version so I could have the latest. However, I’m finding that having automated backups on a system that sleeps will not let the built in automation of deja-dup run. I was hoping that deja-dup backup would trigger on system wake if it had missed a backup.

This was a problem on the repo package 45.2 and on the flatpak version 50. I tried a bunch of systemd service/timer items and because of flatpak I was having mixed results. Even google AI was getting confused. I’m thinking of going back to the repo v 45.2 as I’m hoping the systemd part might be simpler.

Is there any help on this that works. I see a lot of results in google searches, but not all of it is helpful.

Further information. I’ve included the systemd service/timer I’m using for the Debian 13 repo version 45.2 of deja-dup, where it seems to work reliably, but will not work on the latest flatpak version when just changing the ExecStart= to run the flatpak version. Google AI showed me a lot of flatpak problem with using systemd After= and WantedBy= network related events. Many Dbus XDG problems as well.

I put this file, deja-dup-backup.service, in ~/.config/systemd/user/

[Unit]
Description=Déjà Dup Backup Automation
After=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/bin/deja-dup --backup

[Install]
WantedBy=default.target

I put this file, deja-dup-backup.timer, in ~/.config/systemd/user/

[Unit]
Description=Run Déjà Dup Backup Daily

[Timer]
OnBootSec=15min
OnCalendar=--* 23:35:00
Persistent=true

# Tells systemd to wake the system from suspend/hibernate if supported by hardware.
WakeSystem=true

[Install]
WantedBy=timers.target

Then run:

systemctl –user daemon-reload

systemctl –user enable –now deja-dup-backup.timer


while my test on the Debian 13 repo version of deja-dup v45.2 using systemd for automation seems to work. I ran it thru Claude AI and it suggested some things.

  • Flatpak is not intended to run apps headless in systemd services.
  • Second it suggest some mods to the services routine.
  • deja-dup v45.2 from the repo is reliable and does what I want, so no need to use the flatpak version
[Unit]
Description=Déjà Dup Backup Automation
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
ExecCondition=/bin/mountpoint -q /srv/networkbackup

Block suspend/sleep for the duration of the backup

ExecStart=systemd-inhibit 
–what=sleep:idle 
–who=“deja-dup” 
–why=“Backup in progress” 
/usr/bin/deja-dup --backup

Give it time to finish — default 90s is too short for NAS backups

TimeoutStartSec=3600

[Install]
WantedBy=default.target

It also suggested on multi-user PC to make this work when a 2nd user isn’t logged in when it’s time to run the service, run the following:

sudo loginctl enable-linger <username>