Index: /issm/trunk/cron/nightlyrun.sh
===================================================================
--- /issm/trunk/cron/nightlyrun.sh	(revision 1610)
+++ /issm/trunk/cron/nightlyrun.sh	(revision 1611)
@@ -6,5 +6,4 @@
 function timer()
 {
-	#if no input: return time, else return elapsed time
 	if [[ $# -eq 0 ]]; then
 		echo $(date '+%s')
@@ -22,10 +21,11 @@
 	fi
 }
-function today_date()
+function todaydate()
 {
-	#return today date
+	export today=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'`; 
 	suffix=`date | awk '{printf("%s-%s-%s",$2,$3,$6);}'`			 
-	echo $suffix;
+	echo $suffix;			 
 } 
+
 function host_name()
 {
@@ -39,4 +39,5 @@
 	echo $HOST_NAME;
 } 
+
 
 #get configs
@@ -57,4 +58,5 @@
 export ISSM_RELEASE="issm"
 export OS
+
 
 #create ISSM variables
@@ -118,11 +120,11 @@
 then
 	cd $ISSM_DIR/src/c
-	./intel-compile.sh
+	./intel-compile.sh >> ../../c-compilation.log 2>&1
 	cd $ISSM_DIR/src/mex
-	make install
+	make install >> ../../mex-compilation.log 2>&1
 	cd $ISSM_DIR
 else
-	make -j $NUMCPUS
-	make -j $NUMCPUS install
+	make -j $NUMCPUS >> ../../cmex-compilation.log 2>&1
+	make -j $NUMCPUS install >> ../../cmex-compilation.log 2>&1
 fi
 
@@ -130,8 +132,16 @@
 export ELAPSED_INSTAL=$(timer $START_TIME)
 
+#windows environments: ISSM_DIR_WIN variable not correctly picked up when using 
+#the cron job. just get startup to take the ISSM_DIR variable as the pwd:
+if [[ "$OS" == "winxp32" ]]
+then
+	cat startup.m | sed 's/clear status/clear status; ISSM_DIR=pwd;/g' > startup.m.bak
+	mv startup.m.bak startup.m
+fi
+
+
 #Launch matlab and the nightly run script
 cat > matlab_run.m << EOF
 startup
-warning off
 nightlyrun($PACKAGES);
 exit
@@ -162,5 +172,5 @@
 From: "ISSM Nightly run" <$EMAIL_ADRESS>
 To: $i
-Subject: Nightly runs of $ISSM_RELEASE, operating system: $OS.
+Subject: Nightly runs of $ISSM_RELEASE , operating system: $OS.
 Mime-Version: 1.0
 Content-Type: text/html
@@ -170,5 +180,5 @@
 From: "ISSM Nightly run" <$EMAIL_ADRESS>
 To: $i
-Subject: Nightly runs of $ISSM_RELEASE, operating system: $OS.
+Subject: Nightly runs of $ISSM_RELEASE , operating system: $OS.
 Mime-Version: 1.0
 Content-Type: text/html
