#
# $Id: crontab 2586 2009-03-17 13:30:54Z owes $
#
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
HOME=/
!mailto()

# Log rotation
0 * * * *	/usr/sbin/logrotate /etc/logrotate.conf

# Logwatch
%daily 10 *	/usr/local/bin/logwatch > /var/log/logwatch/`date -I -d yesterday`; \
		LOGWATCH_KEEP=$(sed -ne 's/^LOGWATCH_KEEP=\([0-9]\+\)$/\1/p' /var/ipcop/logging/settings); \
		find /var/log/logwatch/ -ctime +${LOGWATCH_KEEP=56} -exec rm -f '{}' ';'

# Backup logs to flashdisk
30 * * * *	/etc/rc.d/rc.flash.down

# Make some nice graphs
*/5 * * * *	/usr/local/bin/makegraphs >/dev/null

# Scheduler
*/5 * * * *	/usr/local/bin/scheduler.pl fcron >/dev/null

# Force update the dynamic dns registration once a week
# Force update even if IP has not changed once a month if 'minimize update' selected in GUI
# to avoid account declared as dead
*/5 * * * *	[ -f "/var/ipcop/red/active" ] && /usr/local/bin/setddns.pl
9 2 * * sun	[ -f "/var/ipcop/red/active" ] && /usr/local/bin/setddns.pl -f
3 2 1 * *	[ -f "/var/ipcop/red/active" ] && /usr/local/bin/setddns.pl -f -m

# Check (every 5 minutes) if iptables rules need an update
*/5 * * * *	/usr/local/bin/setfwrules -c > /dev/null

# Aggregate traffic data (every 5 minutes)
*/5 * * * *	/usr/local/bin/aggregatetraffic.pl > /dev/null

# Check for updates once a day, for IPCops with permanent connections
20 4 * * *	/usr/local/bin/updatelists.pl fcron
