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

Annotation of /mitgcm.org/scripts/daily_update

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


Revision 1.4 - (hide annotations) (download)
Mon Jan 8 23:51:57 2018 UTC (6 years, 4 months ago) by jmc
Branch: MAIN
Changes since 1.3: +35 -26 lines
- use local path (instead of absolute path)
- switch to ssh & :ext:jmc@mitgcm.org to update from CVS (instead of
   using local disk /u/gcmpack)

1 jmc 1.1 #! /usr/bin/env bash
2    
3 jmc 1.4 # $Header: /u/gcmpack/mitgcm.org/scripts/daily_update,v 1.3 2018/01/03 16:40:30 jmc Exp $
4 jmc 1.1
5 jmc 1.4 # Run in: ~/testing/ to update several dir. which are used for:
6 jmc 1.1 # - front_page building
7     # - processing testing emails (-> testing page, part of front_page building)
8     # - making a daily tar file of source code
9    
10 jmc 1.4 export CVS_RSH=ssh
11     export CVSROOT=':ext:jmc@mitgcm.org:/u/gcmpack'
12 jmc 1.1
13 jmc 1.4 #- update scripts dir:
14     if test -d scripts ; then
15     echo -n 'Update dir: '
16     ( cd scripts && pwd && cvs -q update -P -d )
17     fi
18 jmc 1.1
19 jmc 1.2 #- update csail testing scripts:
20 jmc 1.4 if test -d csail ; then
21     echo -n 'Update dir: '
22     ( cd csail && pwd && cvs -q update -P -d )
23     fi
24 jmc 1.2
25 jmc 1.4 #-- update tools/mpack-1.6 dir:
26     if test -d tools_mpack ; then
27     echo -n 'Update dir: '
28     tmpFil=/tmp/TTT.daily_snapshot.$$
29     exe=munpack
30     ( cd tools_mpack ; pwd
31     chg=`cvs -q update -P -d | tee $tmpFil | sed '/^?/d' | wc -l`
32     #echo "chg ='$chg'"
33     cat $tmpFil ; rm -f $tmpFil
34     if test "x$chg" != x0 ; then
35     if test -f $exe ; then echo " removing: $exe force re-build." ; fi
36     rm -f $exe
37     fi
38     )
39 jmc 1.1 fi
40    
41     #- update front-page building dir:
42 jmc 1.4 if test -d front_content ; then
43     echo -n 'Update dir: '
44     ( cd front_content && pwd && cvs -q update -P -d )
45     fi
46 jmc 1.1
47     #-- clean-up old log files:
48 jmc 1.4 cd logs
49     n=$(( `ls bld_manual.* 2>/dev/null | wc -l` - 10 ))
50 jmc 1.1 if test $n -gt 0 ; then
51 jmc 1.3 echo -n ' remove files: '
52 jmc 1.1 ls -lt bld_manual.* | tail -"$n"
53     ls -t bld_manual.* | tail -"$n" | xargs rm -f
54     fi
55 jmc 1.4 p=`ls check_outp_*.txt_bak 2>/dev/null | wc -l`
56     n=$(( `ls check_outp_*.txt 2>/dev/null | wc -l` - 15 ))
57 jmc 1.1 if test $p -gt 0 -o $n -gt 0 ; then echo -n ' remove files: ' ; fi
58     if test $p -gt 0 ; then
59     ls check_outp_*.txt_bak
60     rm -f check_outp_*.txt_bak
61     fi
62     if test $n -gt 0 ; then
63     ls -lt check_outp_*.txt | tail -"$n"
64     ls -t check_outp_*.txt | tail -"$n" | xargs rm -f
65     fi

  ViewVC Help
Powered by ViewVC 1.1.22