Examples of systemd units that I crafted over time
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
617 B

[Unit]
Description=Backup the content of /mnt/test
Documentation=https://github.com/nmasse-itix/Systemd-Examples
Before=mnt-test.mount
RequiresMountsFor=/mnt/backup
ConditionPathIsMountPoint=!/mnt/test
# Unless DefaultDependencies= is set to false, service units will implicitly
# have dependencies of type Requires= and After= on basic.target as well as
# dependencies of type Conflicts= and Before= on shutdown.target.
#
# So, we need to set DefaultDependencies to "no" to break the ordering cycle.
DefaultDependencies=no
[Service]
Type=oneshot
UMask=077
ExecStart=tar -cf /mnt/backup/mnt-test.tar -C /mnt/test .