| 48 |
|
|
| 49 |
#exit |
#exit |
| 50 |
backupDir="other_checkpoints" |
backupDir="other_checkpoints" |
| 51 |
if test -d ../$backupDir ; then |
if test ! -d ../$backupDir ; then |
|
#ls -ld ../$backupDir |
|
|
else |
|
| 52 |
echo -n " make dir: $backupDir" |
echo -n " make dir: $backupDir" |
| 53 |
mkdir ../$backupDir |
mkdir ../$backupDir |
| 54 |
outp=$? |
outp=$? |
| 59 |
echo " Done" |
echo " Done" |
| 60 |
ls -ld ../$backupDir |
ls -ld ../$backupDir |
| 61 |
fi |
fi |
| 62 |
|
#else |
| 63 |
|
# ls -ld ../$backupDir |
| 64 |
fi |
fi |
| 65 |
|
|
| 66 |
savRepo="${git_code}_git" |
savRepo="${git_code}_git" |
| 78 |
if test -f $version_file ; then |
if test -f $version_file ; then |
| 79 |
thischkpt=`awk '/^checkpoint/{print $1; exit}' $version_file` |
thischkpt=`awk '/^checkpoint/{print $1; exit}' $version_file` |
| 80 |
short=`echo $thischkpt | sed 's/checkpoint/c/'` |
short=`echo $thischkpt | sed 's/checkpoint/c/'` |
| 81 |
chkptar="MITgcm_$short" |
chkptar="MITgcm_${short}.tar" |
| 82 |
if test -f ../$chkptar.tar.gz ; then |
if test -f ../$chkptar.gz ; then |
| 83 |
echo "tar file ($chkptar) exist for current tag: $thischkpt" |
echo "tar file ($chkptar) exist for current tag: $thischkpt" |
| 84 |
else |
else |
| 85 |
echo -n " ; checkpoint archive file ... " |
echo -n 'Creating the checkpoint archive file ... ' |
| 86 |
( cd $git_code ; git archive --prefix MITgcm/ -o ../$chkptar $thischkpt ) |
( cd $git_code ; git archive --prefix MITgcm/ -o ../$chkptar $thischkpt ) |
| 87 |
outp=$? |
outp=$? |
| 88 |
if test $outp != 0 ; then |
if test $outp != 0 ; then |
| 91 |
else |
else |
| 92 |
echo " Done" |
echo " Done" |
| 93 |
fi |
fi |
| 94 |
gzip $chkptar.tar |
gzip -9 $chkptar |
| 95 |
ls -l $chkptar.tar* |
ls -l ${chkptar}* |
| 96 |
mv $chkptar.tar.gz .. |
mv $chkptar.gz .. |
| 97 |
#-- move previous tar file to backupDir |
#-- move previous tar file to backupDir |
| 98 |
cd .. |
cd .. |
| 99 |
listTar=`ls MITgcm_c*.tar.gz` |
listTar=`ls MITgcm_c*.tar.gz` |
| 100 |
for xx in $listTar ; do |
for xx in $listTar ; do |
| 101 |
if test $xx != $chkptar.tar.gz ; then |
if test $xx != $chkptar.gz ; then |
| 102 |
if test -f other_checkpoints/$xx ; then |
if test -f other_checkpoints/$xx ; then |
| 103 |
echo "error: $backupDir/$xx already exist" |
echo "error: $backupDir/$xx already exist" |
| 104 |
else |
else |