mkbackup-btrfs/files/lib/systemd/system/btrfs-balance@.service
2019-03-05 13:20:31 +01:00

41 lines
1.3 KiB
Desktop File

[Unit]
Description=Balance btrfs-filesystem %f
#ConditionPathExists=!/run/btrfs-actions
#ConditionDirectoryNotEmpty=!/run/btrfs-actions
#ConditionPathExists=!/run/mkbackup
#ConditionDirectoryNotEmpty=!/run/mkbackup
ConditionACPower=true
Conflicts=sleep.target suspend.target shutdown.target
Wants=btrfs-scrub@%i.service
OnFailure=status-email-root@%n.service
Wants=status-email-root@%n.service
Before=status-email-root@%n.service
RefuseManualStart=true
[Service]
RuntimeDirectory=btrfs-actions
Type=oneshot
#Restart=always
Nice=12
IOSchedulingClass=3
#IOSchedulingPriority=
CPUSchedulingPolicy=idle
ExecStartPre=/bin/touch /run/btrfs-actions/balance-systemd.lock
#ExecStart=/bin/btrfs balance start -musage=0 -dusage=0 -v %f
ExecStart=/bin/btrfs balance start -musage=5 -dusage=5 -v %f
#ExecStart=/bin/btrfs balance start -musage=10 -v %f
#ExecStart=/bin/btrfs balance start -musage=40 -v %f
#ExecStart=/bin/btrfs balance start -musage=60 -v %f
#ExecStart=/bin/btrfs balance start -dusage=0 -v %f
#ExecStart=/bin/btrfs balance start -dusage=5 -v %f
#ExecStart=/bin/btrfs balance start -dusage=10 -v %f
#ExecStart=/bin/btrfs balance start -dusage=40 -v %f
#ExecStart=/bin/btrfs balance start -dusage=65 -v %f
ExecStop=/usr/lib/systemd/scripts/btrfs-action.sh %f balance $MAINPID
ExecStopPost=/bin/rm /run/btrfs-actions/balance-systemd.lock