#!/bin/bash LOC=`dirname "$0"` cd "$LOC"/.. source commonlib/shlib/deployfns read_conf config/general # Specific file if specified if [ x$1 != x ] then case "$1" in /*) f=$1 ;; *) f=$(pwd)/$1 ;; esac cd "$LOC" bundle exec rails runner 'MailServerLog.load_file("'$f'")' exit fi # Load in last three days worth of logs (if they've been modified) cd "$LOC" LATEST=$( ls $OPTION_MTA_LOG_PATH 2>/dev/null | sort | tail -3 ) for X in $LATEST do bundle exec rails runner 'MailServerLog.load_file("'$X'")' done