Database Logging Daemon for samba on SME Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
425 B

#!/bin/bash
LOG=$(/sbin/e-smith/db configuration getprop samba-db-logd status || echo 'disabled')
if [ "$LOG" != "enabled" ]; then
exit 0
fi
RETENTION=$(/sbin/e-smith/db configuration getprop samba-db-logd Retention || echo 370)
DB=$(/sbin/e-smith/db configuration getprop samba-db-logd DbName || echo samba_log)
echo "delete from audit where date_day<DATE_SUB(NOW(), INTERVAL $RETENTION DAY);" | /usr/bin/mysql $DB