File: LOGROTATE

package info (click to toggle)
cruft-ng 0.9.78
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,904 kB
  • sloc: cpp: 1,748; sh: 816; python: 262; makefile: 97; ansic: 82; perl: 75
file content (28 lines) | stat: -rwxr-xr-x 468 bytes parent folder | download
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
#!/bin/sh

test -z "$CRUFT_ROOT" || exit 0

# /etc/logrotate.d/dpkg always exists

for definition in /etc/logrotate.d/*
do
	#dpkg -S $definition is too slow
	package=${definition##*/}
	case "$package" in
		alternatives)
			echo ALTERNATIVES
			;;
		btmp|wtmp)
			echo logrotate
			;;
		*)
			echo "$package"
			;;
	esac

	grep ^/ "$definition" | cut -d ' ' -f 1 | cut -d '.' -f 1 | while read -r file
	do
		find /var/log -path "${file}*" 2>/dev/null
	done
done
exit 0