#!/bin/sh # set this to whatever file/path you like RELAYS='/var/www/html/relays.txt' DATE=`date -d "yesterday" "+%b %e"` grep "$DATE" /var/log/maillog | rtgrab.pl | sort | uniq >$RELAYS