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" |
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" |
74 |
ls -l ${savRepo}* |
ls -l ${savRepo}* |
75 |
|
|
76 |
#-- test for new checkpoint |
#-- test for new checkpoint |
77 |
version_file="$git_code/doc/tag-index" |
version_file="$git_code/doc/tag-index" |
78 |
|
#version_file="$git_code/.git/config" |
79 |
if test -f $version_file ; then |
if test -f $version_file ; then |
80 |
thischkpt=`awk '/^checkpoint/{print $1; exit}' $version_file` |
thischkpt=`awk '/^checkpoint/{print $1; exit}' $version_file` |
81 |
|
#- better way to get latest tag ( but only works with git version 2 ) |
82 |
|
#thischkpt=`(cd $git_code ; git tag -l --sort=-authordate | head -n 1 )` |
83 |
short=`echo $thischkpt | sed 's/checkpoint/c/'` |
short=`echo $thischkpt | sed 's/checkpoint/c/'` |
84 |
chkptar="MITgcm_$short" |
chkptar="MITgcm_${short}.tar" |
85 |
if test -f ../$chkptar.tar.gz ; then |
if test -f ../$chkptar.gz ; then |
86 |
echo "tar file ($chkptar) exist for current tag: $thischkpt" |
echo "tar file ($chkptar) exist for current tag: $thischkpt" |
87 |
else |
else |
88 |
echo -n " ; checkpoint archive file ... " |
echo -n 'Creating the checkpoint archive file ... ' |
89 |
( cd $git_code ; git archive --prefix MITgcm/ -o ../$chkptar $thischkpt ) |
( cd $git_code ; git archive --prefix MITgcm/ -o ../$chkptar $thischkpt ) |
90 |
outp=$? |
outp=$? |
91 |
if test $outp != 0 ; then |
if test $outp != 0 ; then |
94 |
else |
else |
95 |
echo " Done" |
echo " Done" |
96 |
fi |
fi |
97 |
gzip $chkptar.tar |
gzip -9 $chkptar |
98 |
ls -l $chkptar.tar* |
ls -l ${chkptar}* |
99 |
mv $chkptar.tar.gz .. |
mv $chkptar.gz .. |
100 |
#-- move previous tar file to backupDir |
#-- move previous tar file to backupDir |
101 |
cd .. |
cd .. |
102 |
listTar=`ls MITgcm_c*.tar.gz` |
listTar=`ls MITgcm_c*.tar.gz` |
103 |
for xx in $listTar ; do |
for xx in $listTar ; do |
104 |
if test $xx != $chkptar.tar.gz ; then |
if test $xx != $chkptar.gz ; then |
105 |
if test -f other_checkpoints/$xx ; then |
if test -f other_checkpoints/$xx ; then |
106 |
echo "error: $backupDir/$xx already exist" |
echo "error: $backupDir/$xx already exist" |
107 |
else |
else |