dspam Package does not contain cron'ed execution of dspam_logrotate.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dspam (Ubuntu) |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
Binary package hint: dspam
In the dspam documentation, under "NIGHTLY MAINTENANCE AND HOUSEKEEPING CRONS", the need for running dspam_logrotate on a regular basis is noted:
>Log Rotation
>
> The system log and user logs can fill up fairly quickly, when all that's
> really needed to generate graphs are the last two to three weeks of data.
> You can configure a nightly log cleanup using dspam_logrotate:
>
> 0 0 * * * dspam_logrotate -a 30 -d /usr/local/
I couldn't find a script/cron'ed instance of this in the scripts and configuration installed by the package, so I wrote one in /etc/cron.
#!/bin/sh
#
# Rotate DSPAM's data files as suggested by the DSPAM documentation.
DSPAMCONF=
DSPAMHOME="`grep -i "^Home" $DSPAMCONF | awk '{print $2}'`"
if [ -n "$DSPAMHOME" -a -e "$DSPAMHOME/data" ]; then
SYSTEMLOG="`grep -i "^SystemLog" $DSPAMCONF | awk '{print $2}' | tr '[:upper:]' '[:lower:]'`"
USERLOG="`grep -i "^UserLog" $DSPAMCONF | awk '{print $2}' | tr '[:upper:]' '[:lower:]'`"
if [ "$SYSTEMLOG" = "on" -o "$USERLOG" = "on" ]; then
if [ -x /usr/bin/
/
fi
fi
fi
exit 0
Changed in dspam: | |
importance: | Undecided → Wishlist |
Changed in dspam (Ubuntu): | |
status: | New → Fix Released |
Whoops. I had the wrong directory being passed to dspam_logrotate. It should take DSPAM home.
#!/bin/sh
#
# Rotate DSPAM's data files as suggested by the DSPAM documentation.
DSPAMCONF= /etc/dspam/ dspam.conf
DSPAMHOME="`grep -i "^Home" $DSPAMCONF | awk '{print $2}'`"
if [ -n "$DSPAMHOME" -a -e "$DSPAMHOME" ]; then
SYSTEMLOG="`grep -i "^SystemLog" $DSPAMCONF | awk '{print $2}' | tr '[:upper:]' '[:lower:]'`"
USERLOG="`grep -i "^UserLog" $DSPAMCONF | awk '{print $2}' | tr '[:upper:]' '[:lower:]'`"
if [ "$SYSTEMLOG" = "on" -o "$USERLOG" = "on" ]; then dspam_logrotate ]; then usr/bin/ dspam_logrotate -a 45 -d "$DSPAMHOME"
if [ -x /usr/bin/
/
fi
fi
fi
exit 0