coreos-home-server/service/rclone/systemd/rclone-pull-volume@.service

16 lines
702 B
Desktop File

[Unit]
Description=Rclone Pull for Volume %I
Wants=container-build@rclone.service container-volume@%i.service
After=container-build@rclone.service container-volume@%i.service
[Service]
Type=oneshot
SyslogIdentifier=%N
Environment=SOURCE=crypt:%i
ExecCondition=/bin/bash -c 'test -n "$(ls --almost-all $(podman volume mount %i))"; status=$?; podman volume unmount %i; exit $status'
ExecStartPre=/bin/install --mode 0700 -d %S/backups/coreos-home-server/%i
ExecStart=/bin/podman run --rm --env-file %E/coreos-home-server/rclone/rclone.env --user root --volume %i:/mnt:z --volume %S/backups/coreos-home-server/%i:/local:z localhost/rclone:latest sync ${SOURCE} /mnt
[Install]
WantedBy=multi-user.target