To archive personal data I use Unison over SSH to copy the data to a remote server.

Install unison

I have cloned the author’s repository on Github and installed the executable to ~/.local/bin/unison, which I have added to my PATH.

Systemd user timer

Add the following templated Systemd timer (i.e. [email protected]) and it’s corresponding service (i.e. [email protected]) under ~/.config/systemd/user, while making sure to update the path to the unison executable:

[Unit]
Description=Synchronize ~/%i to the remote server

[Service]
Type=oneshot
ExecStart=/home/user/.local/bin/unison -auto -batch -times \
                                       /home/user/%i \
                                       ssh://remote-server/%i
[Unit]
Description=Synchronize ~/%i/ to the remote server

[Timer]
OnBootSec=10m
OnUnitActiveSec=10m

[Install]
WantedBy=timers.target

I enabled archiving of a directory named ‘doc’ in my home directory as follows:

systemctl --user enable [email protected]
systemctl --user start [email protected]

Then check that the timer ran:

systemctl --user list-timers --all

References