/[MITgcm]/mitgcm.org/scripts/daily_update
ViewVC logotype

Diff of /mitgcm.org/scripts/daily_update

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

--- mitgcm.org/scripts/daily_update	2018/01/03 16:40:30	1.3
+++ mitgcm.org/scripts/daily_update	2018/01/08 23:51:57	1.4
@@ -1,49 +1,59 @@
 #! /usr/bin/env bash
 
-# $Header: /home/ubuntu/mnt/e9_copy/mitgcm.org/scripts/daily_update,v 1.3 2018/01/03 16:40:30 jmc Exp $
+# $Header: /home/ubuntu/mnt/e9_copy/mitgcm.org/scripts/daily_update,v 1.4 2018/01/08 23:51:57 jmc Exp $
 
-# update several dir. which are used for:
+# Run in: ~/testing/ to update several dir. which are used for:
 # - front_page building
 # - processing testing emails (-> testing page, part of front_page building)
 # - making a daily tar file of source code
 
-export CVSROOT=/u/gcmpack
+export CVS_RSH=ssh
+export CVSROOT=':ext:jmc@mitgcm.org:/u/gcmpack'
 
-#- update scripts with explicit path:
-echo -n 'Update dir:'
-cd /u/u2/jmc/testing/scripts && pwd && cvs -q update -P -d
+#- update scripts dir:
+if test -d scripts ; then
+ echo -n 'Update dir: '
+ ( cd scripts && pwd && cvs -q update -P -d )
+fi
 
 #- update csail testing scripts:
-echo -n 'Update dir:'
-cd /u/u2/jmc/testing/csail && pwd && cvs -q update -P -d
+if test -d csail ; then
+ echo -n 'Update dir: '
+ ( cd csail && pwd && cvs -q update -P -d )
+fi
 
-#-- update tools/mpack-1.6 dir :
-tmpFil=/tmp/TTT.daily_snapshot.$$
-exe=munpack
-cd /u/u2/jmc/testing/tools_mpack
-echo -n 'Update dir:' ; pwd
-chg=`cvs -q update -P -d | tee $tmpFil | sed '/^?/d' | wc -l`
-#echo "chg ='$chg'"
-cat $tmpFil ; rm -f $tmpFil
-if test "x$chg" != x0 ; then
-  if test -f $exe ; then echo " removing: $exe force re-build." ; fi
-  rm -f $exe
+#-- update tools/mpack-1.6 dir:
+if test -d tools_mpack ; then
+ echo -n 'Update dir: '
+ tmpFil=/tmp/TTT.daily_snapshot.$$
+ exe=munpack
+ ( cd tools_mpack ; pwd
+   chg=`cvs -q update -P -d | tee $tmpFil | sed '/^?/d' | wc -l`
+  #echo "chg ='$chg'"
+   cat $tmpFil ; rm -f $tmpFil
+   if test "x$chg" != x0 ; then
+     if test -f $exe ; then echo " removing: $exe force re-build." ; fi
+     rm -f $exe
+   fi
+ )
 fi
 
 #- update front-page building dir:
-echo -n 'Update dir:'
-cd /u/u2/jmc/testing/front_content && pwd && cvs -q update -P -d
+if test -d front_content ; then
+ echo -n 'Update dir: '
+ ( cd front_content && pwd && cvs -q update -P -d )
+fi
 
 #-- clean-up old log files:
-cd /u/u2/jmc/testing/logs
-n=$(( `ls bld_manual.* | wc -l` - 10 ))
+cd logs
+n=$(( `ls bld_manual.* 2>/dev/null | wc -l` - 10 ))
 if test $n -gt 0 ; then
   echo -n ' remove files: '
     ls -lt bld_manual.* | tail -"$n"
     ls -t  bld_manual.* | tail -"$n" | xargs rm -f
 fi
-p=`ls check_outp_*.txt_bak | wc -l`
-n=$(( `ls check_outp_*.txt | wc -l` - 15 ))
+p=`ls check_outp_*.txt_bak 2>/dev/null | wc -l`
+n=$(( `ls check_outp_*.txt 2>/dev/null | wc -l` - 15 ))
 if test $p -gt 0 -o $n -gt 0 ; then echo -n ' remove files: ' ; fi
 if test $p -gt 0 ; then
   ls    check_outp_*.txt_bak
@@ -53,4 +63,3 @@
     ls -lt check_outp_*.txt | tail -"$n"
     ls -t  check_outp_*.txt | tail -"$n" | xargs rm -f
 fi
-

 

  ViewVC Help
Powered by ViewVC 1.1.22