| 11 | 
  | 
  | 
| 12 | 
 umask 0002 | 
 umask 0002 | 
| 13 | 
  | 
  | 
| 14 | 
 echo 'Changing dir. to /u/httpd/html/download/daily_snapshot' | 
 echo 'Changing dir. to /u/u0/httpd/html/download/daily_snapshot' | 
| 15 | 
 cd /u/httpd/html/download/daily_snapshot | 
 cd /u/u0/httpd/html/download/daily_snapshot | 
| 16 | 
 outp=$? | 
 outp=$? | 
| 17 | 
 if test $outp != 0 ; then | 
 if test $outp != 0 ; then | 
| 18 | 
    echo " Error in cd : $outp" | 
    echo " Error in cd : $outp" | 
| 19 | 
    exit | 
    exit 1 | 
| 20 | 
 fi | 
 fi | 
| 21 | 
 test -e MITgcm  &&  rm -rf MITgcm | 
 test -e MITgcm  &&  rm -rf MITgcm | 
| 22 | 
  | 
  | 
| 23 | 
 echo 'Checking out MITgcm...' | 
 echo -n 'Checking out MITgcm ... ' | 
| 24 | 
 cvs co -P MITgcm > /dev/null | 
 cvs -q co -P MITgcm > /dev/null | 
| 25 | 
  | 
 outp=$? | 
| 26 | 
  | 
 if test $outp = 0 ; then | 
| 27 | 
  | 
    echo 'Done!' | 
| 28 | 
  | 
 else | 
| 29 | 
  | 
    echo " Error in cvs checkout: $outp" | 
| 30 | 
  | 
    exit 2 | 
| 31 | 
  | 
 fi | 
| 32 | 
 #chgrp gcmpack MITgcm | 
 #chgrp gcmpack MITgcm | 
| 33 | 
 #chmod 775 MITgcm | 
 #chmod 775 MITgcm | 
| 34 | 
  | 
  | 
| 35 | 
 echo 'Creating the tar file...' | 
 rm -f MITgcm_ss_* | 
 | 
 rm -rf MITgcm_ss_* | 
  | 
| 36 | 
 tname='MITgcm_ss_'`date +%Y%m%d`'.tar.gz' | 
 tname='MITgcm_ss_'`date +%Y%m%d`'.tar.gz' | 
| 37 | 
  | 
  | 
| 38 | 
  | 
 echo -n 'Creating the tar file ... ' | 
| 39 | 
 tar -czf $tname ./MITgcm | 
 tar -czf $tname ./MITgcm | 
| 40 | 
  | 
 #- should check if successful, it not -> exit 3 | 
| 41 | 
  | 
 echo 'Done!' | 
| 42 | 
  | 
  | 
| 43 | 
 #chmod 664 $tname | 
 #chmod 664 $tname | 
| 44 | 
 ls -l $tname | 
 ls -l $tname | 
| 45 | 
  | 
  | 
 | 
 echo 'Done!' | 
  | 
 | 
  | 
  | 
| 46 | 
 #-- test for new checkpoint | 
 #-- test for new checkpoint | 
| 47 | 
 cd .. | 
 cd .. | 
| 48 | 
 version_file="daily_snapshot/MITgcm/doc/tag-index" | 
 version_file="daily_snapshot/MITgcm/doc/tag-index" | 
| 56 | 
     else | 
     else | 
| 57 | 
       echo -n "Checking out $thischkpt ..." | 
       echo -n "Checking out $thischkpt ..." | 
| 58 | 
       rm -f checkout.out checkout.err | 
       rm -f checkout.out checkout.err | 
| 59 | 
       cvs co -P -d $chkptar -r $thischkpt MITgcm 1> checkout.out 2> checkout.err | 
       cvs -q co -P -d $chkptar -r $thischkpt MITgcm 1> checkout.out 2> checkout.err | 
| 60 | 
       outp=$? | 
       outp=$? | 
| 61 | 
       if test $outp != 0 ; then | 
       if test $outp != 0 ; then | 
| 62 | 
          echo " Error in cvs checkout: $outp" | 
          echo " Error in cvs checkout: $outp" | 
| 63 | 
          cat checkout.err | 
          cat checkout.err | 
| 64 | 
          exit | 
          exit 4 | 
| 65 | 
       fi | 
       fi | 
| 66 | 
       echo -n " ; making tar file ... " | 
       echo -n " ; making tar file ... " | 
| 67 | 
       rm -f checkout.out checkout.err | 
       rm -f checkout.out checkout.err | 
| 69 | 
       outp=$? | 
       outp=$? | 
| 70 | 
       if test $outp != 0 ; then | 
       if test $outp != 0 ; then | 
| 71 | 
          echo " Error in tar command: $outp" | 
          echo " Error in tar command: $outp" | 
| 72 | 
          exit | 
          exit 5 | 
| 73 | 
       else | 
       else | 
| 74 | 
          echo " Done" | 
          echo " Done" | 
| 75 | 
          rm -r -f $chkptar | 
          rm -r -f $chkptar | 
| 91 | 
         done | 
         done | 
| 92 | 
       else | 
       else | 
| 93 | 
          echo " no dir: $backupDir" | 
          echo " no dir: $backupDir" | 
| 94 | 
          exit | 
          exit 6 | 
| 95 | 
       fi | 
       fi | 
| 96 | 
     fi | 
     fi | 
| 97 | 
 fi | 
 fi | 
 | 
  | 
  |