aboutsummaryrefslogtreecommitdiffstats
path: root/packages/logrotate-script/logrotate-script_cvs.bb
blob: a9dd3805964ea0d674f3de32afc6c6b76d1e8f8f (plain)
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
DESCRIPTION = "simple logrotate bash script"
RDEPENDS = "busybox"
SECTION = "admin"
PRIORITY = "optional"
MAINTAINER = "Bruno Randolf <bruno.randolf@4g-systems.biz>"
LICENSE = "GPL"

SRC_URI = "svn://meshcube.org/svn/scripts;module=logrotate"
S = "${WORKDIR}/${PN}"

do_install() {
	(cd ${S}; tar -c --exclude .svn -f - . ) | tar -C ${D} -xpf -
}

pkg_postinst() {
#!/bin/sh -e
ROOTCRON=/etc/cron/crontabs/root

test -e /etc/cron/crontabs/root \
 && grep '^[^#].*logrotate' $ROOTCRON > /dev/null \
 || echo "*/5 * * * *       /bin/bash ${sbindir}/logrotate -m 0600 -o root -g root -s 800 -l 3 /tmp/messages" >> $ROOTCRON

/etc/init.d/cron restart

exit 0
}