| 44 |
echo 'Done!' |
echo 'Done!' |
| 45 |
|
|
| 46 |
#chmod 664 ${arName}.gz |
#chmod 664 ${arName}.gz |
| 47 |
ls -l ${arName}* |
ls -l ${arName}* | tee -a $HOME/testing/logs/tar_file_list |
| 48 |
|
|
| 49 |
#exit |
#exit |
| 50 |
backupDir="other_checkpoints" |
backupDir="other_checkpoints" |
| 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 |