Changeset 29998
- Timestamp:
- 2015-06-30T18:01:24+12:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/nightly-tasks/crons-and-scripts/do-snapshots-and-latest.sh
r29996 r29998 167 167 echo "" 168 168 #echo "In MAKE_LATEST" 169 170 # Using local variable to loop through files, seen in http://mywiki.wooledge.org/ParsingLs 171 local latest 172 local file 173 local suffix 169 174 170 175 # find the latest file in caveat, since this script is called upon each upload to puka's caveat 171 176 # http://stackoverflow.com/questions/5885934/bash-function-to-find-newest-file-matching-pattern 172 177 # http://mywiki.wooledge.org/BashFAQ/003 178 # http://tldp.org/LDP/abs/html/fto.html, where f1 -nt f2 means file f1 is newer than file f2 179 # http://superuser.com/questions/687523/get-the-last-file-name-in-a-variable-in-bash 180 173 181 unset -v latest 174 for file in "${caveat_dir}"*; do 175 [[ -f $file ]] && [[ $file -nt $latest ]] && latest=$file 182 #for file in "${caveat_dir}"*; do 183 #then file would be the full path. Instead, cd into the caveat dir to just get the filename 184 cd $caveat_dir 185 for file in *; do 186 [[ -f $file ]] && [[ "$file" != *"latest-server.exe" ]] && [[ "$file" != *"Greenstone3-latest-source.tar.gz" ]] && [[ $file -nt $latest ]] && latest=$file 176 187 done 188 cd - 177 189 178 190 # latest will not be undef, because this script is only ever called upon a legitimate 179 191 # file upload into puka's caveat-emptor location 180 # E.g. for testing, latest=Greenstone-3.07-candidate-2015.06. 26-linux192 # E.g. for testing, latest=Greenstone-3.07-candidate-2015.06.30-linux-x64 181 193 echo "Latest file in caveat is: $latest" 182 194 … … 211 223 212 224 # make a hardlink of the $latest file into the caveat_latest folder 225 echo "Making a hardlink to ${caveat_dir}$latest in ${latest_dir}$latest" 213 226 ln ${caveat_dir}$latest ${latest_dir}$latest 214 227 #else
Note:
See TracChangeset
for help on using the changeset viewer.