-
Notifications
You must be signed in to change notification settings - Fork 127
Expand file tree
/
Copy pathatop.service
More file actions
20 lines (18 loc) · 775 Bytes
/
atop.service
File metadata and controls
20 lines (18 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[Unit]
Description=Atop advanced performance monitor
Documentation=man:atop(1)
[Service]
Type=simple
Environment="LOGOPTS="
Environment="LOGINTERVAL=600"
Environment="LOGGENERATIONS=28"
Environment="LOGPATH=/var/log/atop"
EnvironmentFile=/etc/default/atop
ExecStartPre=/bin/sh -c 'test -d "${LOGPATH}" || mkdir -p "${LOGPATH}"'
ExecStartPre=/bin/sh -c 'test -n "$LOGINTERVAL" -a "$LOGINTERVAL" -eq "$LOGINTERVAL"'
ExecStartPre=/bin/sh -c 'test -n "$LOGGENERATIONS" -a "$LOGGENERATIONS" -eq "$LOGGENERATIONS"'
ExecStart=/bin/sh -c 'exec /usr/bin/atop ${LOGOPTS} -w "${LOGPATH}/atop_$(date +%%Y%%m%%d)" ${LOGINTERVAL}'
ExecStartPost=/usr/bin/find "${LOGPATH}" -name "atop_*" -mtime +${LOGGENERATIONS} -exec rm -v {} \;
KillSignal=SIGUSR2
[Install]
WantedBy=multi-user.target