Changeset 15517 for trunk/DataCheck/Transfer
- Timestamp:
- 05/07/13 23:22:58 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/Transfer/ZipRawData.sh
r14840 r15517 15 15 finish 16 16 fi 17 # get last 3, 6 or 9 nights18 dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \ 19 # `date +%Y/%m/%d --date="-84hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-132hour"` \ 20 # `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \ 21 22 23 # get last 3, 6 or 9 nights24 dates=( 25 `date +%Y/%m/%d --date="-204hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-156hour"` \26 `date +%Y/%m/%d --date="-132hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-84hour"`\27 `date +%Y/%m/%d --date="-60hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-12hour"` \28 ) 17 # get current hour 18 hour=`date +%k` 19 if [ $hour -le 7 ] || [ $hour -ge 19 ] 20 then 21 dates=( `date +%Y/%m/%d --date="-12hour"` ) 22 else 23 # get last 3, 6 or 9 nights 24 dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` \ 25 # `date +%Y/%m/%d --date="-84hour"` `date +%Y/%m/%d --date="-108hour"` `date +%Y/%m/%d --date="-132hour"` \ 26 # `date +%Y/%m/%d --date="-156hour"` `date +%Y/%m/%d --date="-180hour"` `date +%Y/%m/%d --date="-204hour"` \ 27 ) 28 fi 29 29 30 30 # setup to use ftools … … 128 128 printprocesslog "INFO zipping "$file" to "$zipfile" ..." 129 129 #echo "INFO zipping "$file" to "$zipfile" ..." 130 source `dirname $0`/../Sourcefile.sh 130 131 # zip file to stdout and pipe it to outputfile 131 if pigz -1 -c -f $file > $zipfiletmp 132 echo "pv --rate-limit $limitpigz $file | pigz -1 -c -f -p 2 > $zipfiletmp" >> $logfile 2>&1 133 pv --rate-limit $limitpigz $file | pigz -1 -c -f -p 2 > $zipfiletmp 134 statuspigz=( `echo ${PIPESTATUS[@]}` ) 135 printprocesslog "DEBUG PIPESTATUS:"${statuspigz[@]} 136 echo " PIPESTATUS:"${statuspigz[@]} >> $logfile 2>&1 137 if [ ${statuspigz[0]} -eq 0 ] && [ ${statuspigz[1]} -eq 0 ] 132 138 then 133 139 # if successful, move temporary to final zipfile … … 136 142 else 137 143 # if not successful, remove temporary zipfile 144 printprocesslog "WARN pigz or pv failed (PIPESTATUS:"${statuspigz[@]}")." 145 echo "WARN pigz or pv failed (PIPESTATUS:"${statuspigz[@]}")." >> $logfile 2>&1 146 finish 138 147 printprocesslog "INFO remove "$zipfiletmp"..." 139 148 rm -v $zipfiletmp >> $logfile 2>&1 … … 142 151 if [ ${diskusage[3]} -lt 10000000 ] 143 152 then 144 echo "WARN less than 10 GB left on /loc_data on data " 153 echo "WARN less than 10 GB left on /loc_data on data " >> $logfile 2>&1 145 154 printprocesslog "WARN less than 10 GB left on /loc_data on data " 146 155 finish
Note:
See TracChangeset
for help on using the changeset viewer.