| 1 |
jmc |
1.1 |
#! /usr/bin/env bash |
| 2 |
|
|
|
| 3 |
jmc |
1.3 |
# $Header: /u/gcmpack/mitgcm.org/scripts/daily_update,v 1.2 2009/06/05 21:00:54 jmc Exp $ |
| 4 |
jmc |
1.1 |
|
| 5 |
|
|
# update several dir. which are used for: |
| 6 |
|
|
# - 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 |
|
|
export CVSROOT=/u/gcmpack |
| 11 |
|
|
|
| 12 |
|
|
#- update scripts with explicit path: |
| 13 |
|
|
echo -n 'Update dir:' |
| 14 |
|
|
cd /u/u2/jmc/testing/scripts && pwd && cvs -q update -P -d |
| 15 |
|
|
|
| 16 |
jmc |
1.2 |
#- update csail testing scripts: |
| 17 |
|
|
echo -n 'Update dir:' |
| 18 |
|
|
cd /u/u2/jmc/testing/csail && pwd && cvs -q update -P -d |
| 19 |
|
|
|
| 20 |
jmc |
1.1 |
#-- update tools/mpack-1.6 dir : |
| 21 |
|
|
tmpFil=/tmp/TTT.daily_snapshot.$$ |
| 22 |
|
|
exe=munpack |
| 23 |
|
|
cd /u/u2/jmc/testing/tools_mpack |
| 24 |
|
|
echo -n 'Update dir:' ; pwd |
| 25 |
|
|
chg=`cvs -q update -P -d | tee $tmpFil | sed '/^?/d' | wc -l` |
| 26 |
|
|
#echo "chg ='$chg'" |
| 27 |
|
|
cat $tmpFil ; rm -f $tmpFil |
| 28 |
jmc |
1.3 |
if test "x$chg" != x0 ; then |
| 29 |
|
|
if test -f $exe ; then echo " removing: $exe force re-build." ; fi |
| 30 |
|
|
rm -f $exe |
| 31 |
jmc |
1.1 |
fi |
| 32 |
|
|
|
| 33 |
|
|
#- update front-page building dir: |
| 34 |
|
|
echo -n 'Update dir:' |
| 35 |
|
|
cd /u/u2/jmc/testing/front_content && pwd && cvs -q update -P -d |
| 36 |
|
|
|
| 37 |
|
|
#-- clean-up old log files: |
| 38 |
|
|
cd /u/u2/jmc/testing/logs |
| 39 |
|
|
n=$(( `ls bld_manual.* | wc -l` - 10 )) |
| 40 |
|
|
if test $n -gt 0 ; then |
| 41 |
jmc |
1.3 |
echo -n ' remove files: ' |
| 42 |
jmc |
1.1 |
ls -lt bld_manual.* | tail -"$n" |
| 43 |
|
|
ls -t bld_manual.* | tail -"$n" | xargs rm -f |
| 44 |
|
|
fi |
| 45 |
|
|
p=`ls check_outp_*.txt_bak | wc -l` |
| 46 |
|
|
n=$(( `ls check_outp_*.txt | wc -l` - 15 )) |
| 47 |
|
|
if test $p -gt 0 -o $n -gt 0 ; then echo -n ' remove files: ' ; fi |
| 48 |
|
|
if test $p -gt 0 ; then |
| 49 |
|
|
ls check_outp_*.txt_bak |
| 50 |
|
|
rm -f check_outp_*.txt_bak |
| 51 |
|
|
fi |
| 52 |
|
|
if test $n -gt 0 ; then |
| 53 |
|
|
ls -lt check_outp_*.txt | tail -"$n" |
| 54 |
|
|
ls -t check_outp_*.txt | tail -"$n" | xargs rm -f |
| 55 |
|
|
fi |
| 56 |
|
|
|