[cig-commits] r6955 - cs/stats/trunk

sue at geodynamics.org sue at geodynamics.org
Thu May 24 14:02:06 PDT 2007


Author: sue
Date: 2007-05-24 14:02:04 -0700 (Thu, 24 May 2007)
New Revision: 6955

Modified:
   cs/stats/trunk/get_all_times
Log:
Make get all times only get the last two months of data, because otherwise the script takes more than a day to complete

Modified: cs/stats/trunk/get_all_times
===================================================================
--- cs/stats/trunk/get_all_times	2007-05-24 16:56:27 UTC (rev 6954)
+++ cs/stats/trunk/get_all_times	2007-05-24 21:02:04 UTC (rev 6955)
@@ -1,5 +1,11 @@
-for month in `cat months`; do
-    for year in `cat years`; do
-    	./get_names ${1} ${month}/${year} > $2_${month}_${year}
-    done
-done
+current_month=`date +%b`
+current_year=`date +%G`
+previous_month=`grep -B 1 $current_month months | head -n 1`
+previous_year=$current_year
+if test -z "$previous_month"; then
+    previous_month="Dec"
+    previous_year=`grep -B 1 $current_year years | head -n 1`
+fi
+
+./get_names ${1} ${current_month}/${current_year} > $2_${current_month}_${current_year}
+./get_names ${1} ${previous_month}/${previous_year} > $2_${previous_month}_${previous_year}



More information about the cig-commits mailing list