14) Edit crontab

Run periodically through crontab

Like the figure in Internal Flow page, You want to run bounceHammer (pasing, logging, inserting to the db, and so on.) periodically, You may use crontab.

Sample configuration of crontab have been installed as INSTALL-DESTINATION/etc/crontab-example .

Setting Up crontab

There is /etc/crontab in generic Linux/UNIX hosts, but If /etc/crontab does not exist, Run the command crontab -e as root user. In this description, bounced emails have been saved in /var/mail/bouncedemail as a mailbox, and have been saved in /home/postmaster/Maildir/new .

Edit crontab as root
# crontab -e
# bounceHammer PARSE | UPDATE | INSERT
BHROOT='/usr/local/bouncehammer'
BMBOX='/var/mail/bouncemail'
BMDIR='/home/postmaster/Maildir/new'

# Run mailboxparser(parsing) every 10 minutes
0-59/10 * * * * ${BHROOT}/bin/mailboxparser -g --log ${BMBOX} --remove
0-59/10 * * * * ${BHROOT}/bin/mailboxparser -g --log ${BMDIR} --remove

# Run logger every 15 minutes
0-59/15 * * * * ${BHROOT}/bin/logger -c --remove

# Insert today's parsed log into the database an hour
00 * * * * ${BHROOT}/bin/databasectl --update --today

# 3 a.m., Insert yesterday's parsed log into the database
00 03 * * * ${BHROOT}/bin/databasectl --update --yesterday

After you have set the crontab, bounceHammer will run periodically.

No TrackBacks

TrackBack URL: http://bouncehammer.jp/cgi-bin/mt/mt-tb.cgi/125

Leave a comment