File: logrotate

package info (click to toggle)
mirrorbits 0.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 984 kB
  • sloc: sh: 675; makefile: 93
file content (39 lines) | stat: -rw-r--r-- 808 bytes parent folder | download | duplicates (3)
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
/var/log/mirrorbits/*.log {
	daily
 	rotate 14
	missingok
	notifempty
	compress
	delaycompress
	postrotate
		if [ -e /run/systemd/system ]; then
			if systemctl -q is-active mirrorbits; then
				systemctl kill -s USR1 mirrorbits
			fi
		elif [ -s /run/mirrorbits/pid ]; then
			pid=$(cat /run/mirrorbits/pid)
			kill -s USR1 "$pid" 2>/dev/null || true
		fi
	endscript
}

/var/log/mirrorbits/*/*.log {
	daily
 	rotate 14
	missingok
	notifempty
	compress
	delaycompress
	postrotate
		dir=$(dirname "$1")
		i=$(basename "$dir")
		if [ -e /run/systemd/system ]; then
			if systemctl -q is-active mirrorbits@"$i"; then
				systemctl kill -s USR1 mirrorbits@"$i"
			fi
		elif [ -s /run/mirrorbits/"$i"/pid ]; then
			pid=$(cat /run/mirrorbits/"$i"/pid)
			kill -s USR1 "$pid" 2>/dev/null || true
		fi
	endscript
}