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

I have added the following templated Systemd timer, and it’s corresponding service, for my user under ~/.config/systemd/user:

[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]

References