Create a gist now

Instantly share code, notes, and snippets.

A CRON job that emails me a list of domains set to expire the next day
$tomorrow = mktime(0, 0, 0, date("m"), date("d")+1, date("Y"));
$tomorrow_egrep = date('n/j/Y', $tomorrow); # like "10/19/2012" without quotes
$shellCommands= <<<END
rm ~/temp/ ~/temp/PoolDeletingDomainsList.txt ~/temp/email_tmp.txt ~/temp/tomorrow.txt;
wget -O ~/temp/ -q;
unzip -o ~/temp/ -d ~/temp/;
egrep -e "{$tomorrow_egrep}" ~/temp/PoolDeletingDomainsList.txt > ~/temp/tomorrow.txt;
egrep "^[a-z]{2,7}," ~/temp/tomorrow.txt > ~/temp/email_tmp.txt;
echo "-----" >> ~/temp/email_tmp.txt;
egrep "^[a-z]{2,7}.com," ~/temp/tomorrow.txt >> ~/temp/email_tmp.txt;
cut -d, -f1 ~/temp/email_tmp.txt > ~/temp/email.txt;
cat ~/temp/email.txt | sed 's/\\n/ /g' | mail -s "Expiring domains"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment