Commits

Jason Baldridge committed c5a0ee5

Added email notification script from Hohyon and Matt with slight modifications.

  • Participants
  • Parent commits 48be227

Comments (0)

Files changed (1)

File bin/email_when_run.sh

+#!/bin/bash -u
+
+#Subject: 	[dicta] The script to email yourself when your TACC job is ready
+#Date: 	Thu, 1 Sep 2011 14:29:54 -0500
+#From: 	Hohyon Ryu 
+#
+#Here's the script to email yourself when your TACC job is ready.
+#
+# Example use:
+#
+# cat qsub.sh
+#qstat
+#echo "Deleting .hadoop2 logs"
+#rm -rf ~/.hadoop2/logs
+#rm Hadoop*
+#echo "Submiting Job.."
+#qsub job.hadoop.new
+#email_when_run.sh &
+
+# input argument or replace with hard-coded
+if [ -z $EMAIL ] 
+then
+    EMAIL=$1
+fi
+
+AVAIL=`qstat | grep $USER | awk '{print $5}'`;
+
+echo "Waiting until hadoop runs...";
+while [ $AVAIL == "qw" ]; do
+       AVAIL=`qstat | grep $USER | awk '{print $5}'`;
+       sleep 10;
+done
+
+echo "It is running now!"
+echo "$AVAIL: `date` ";
+
+mail_cont="go ahead and do it!"
+mail -s "TACC Hadoop job is Running!" "$EMAIL" < Hadoop-test.out
+