-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathautotrim.sls
41 lines (36 loc) · 961 Bytes
/
autotrim.sls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
zpool-trim@.service:
file.managed:
- name: /etc/systemd/system/zpool-trim@.service
- contents: |
[Unit]
Description=ZFS Pool Trim on %i
Requires=zfs.target
After=zfs.target
ConditionACPower=true
ConditionPathIsDirectory=/sys/module/zfs
[Service]
Nice=19
IOSchedulingClass=idle
KillSignal=SIGINT
ExecStartPre=-zpool trim -c %I
ExecStart=zpool trim -w %I
zpool-trim@.timer:
file.managed:
- name: /etc/systemd/system/zpool-trim@.timer
- contents: |
[Unit]
Description=ZFS Pool Trim monthly on %i
[Timer]
OnCalendar=monthly
AccuracySec=1h
Persistent=true
[Install]
WantedBy=timers.target
- require:
- file: zpool-trim@.service
zpool-trim:
cmd.run:
- name: systemctl daemon-reload
- onchanges:
- file: zpool-trim@.service
- file: zpool-trim@.timer