aboutsummaryrefslogtreecommitdiffstats
path: root/debian/sitesummary.cron.daily
blob: bb8dbc7525757d467a536da48db888b9291f0f0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
#
# Author: Petter Reinholdtsen

daylimit=120
makewebreport=/usr/sbin/sitesummary-makewebreport

[ -f /etc/sitesummary/collector.cfg ] && . /etc/sitesummary/collector.cfg

# The storage area is not configurable, because too many scripts have it hardcoded
entriesdir=/var/lib/sitesummary/entries

remove_old_entries() {
    find $entriesdir/. -mindepth 1 -maxdepth 1 -type d \
	-daystart -mtime +$daylimit -print0 |
    xargs -0 -r rm -rf
}

[ -d $entriesdir ] && remove_old_entries

# Update the web report once a day
[ -x $makewebreport ] && nice $makewebreport