Changeset 13054 for trunk/DataCheck
- Timestamp:
- 03/09/12 22:18:35 (13 years ago)
- Location:
- trunk/DataCheck/Transfer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/Transfer/BackupAuxToWue.sh
r13046 r13054 1 1 #!/bin/bash 2 2 3 isdcauxdata=/data00/fact-construction/aux/ 4 wueauxdata=/fact/aux 3 # this script has been written to run on La Palma on the machine data 4 # i.e. paths are only working on this machine 5 5 6 today=`date +%F-%H-%M-%S` 7 logfile=~/DataCheck/log/BackupAuxToWue$today.log 6 source `dirname $0`/../Sourcefile.sh 7 printprocesslog "INFO starting "$0 8 8 9 echo "" >> $logfile 2>&1 10 echo "" >> $logfile 2>&1 11 echo "" >> $logfile 2>&1 12 echo `date`": start rsync of auxiliary data to Wuerzburg" >> $logfile 2>&1 9 logfile=$runlogpath"/RsyncAuxToWue-"$datetime".log" 10 date >> $logfile 13 11 14 #rsync from ISDC to Wue DC 15 if ! /usr/bin/rsync -avxH --no-p $isdcauxdata operator@coma.astro.uni-wuerzburg.de:$wueauxdata >> $logfile 2>&1 16 then 17 echo `date`": problem rsyncing auxiliary data from ISDC ("$HOST") to Wuerzburg" 18 fi 12 # get last 3 nights 13 dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` ) 19 14 15 # do rsync for rawfiles of these dates 16 for date in ${dates[@]} 17 do 18 echo "" >> $logfile 2>&1 19 # auxiliary data directories 20 auxdirisdc=/scratch/from_lapalma/aux/./$date/ 21 auxdirwue=/fact/aux 22 23 if ! [ -d $auxdirisdc ] 24 then 25 printprocesslog "INFO "$auxdirisdc" not available." >> $logfile 2>&1 26 continue 27 fi 28 printprocesslog "INFO processing files in "$auxdirisdc >> $logfile 2>&1 29 echo `date`": processing files in "$auxdirisdc >> $logfile 2>&1 30 31 #rsync from ISDC to Wue 32 if ! rsync -rltDvR --stats $auxdirisdc operator@coma.astro.uni-wuerzburg.de:$auxdirwue >> $logfile 2>&1 33 then 34 printprocesslog "WARN problem rsyncing auxiliary data for "$date" from ISDC to Wue" 35 echo `date`": problem rsyncing auxiliary data for "$date" from ISDC to Wue" >> $logfile 2>&1 36 echo `date`": problem rsyncing auxiliary data for "$date" from ISDC to Wue" 37 fi 38 done 20 39 -
trunk/DataCheck/Transfer/BackupRawToWue.sh
r13046 r13054 1 #!/bin/bash 1 #!/bin/sh 2 # 2 3 3 isdcrawdata=/data00/fact-construction/raw/ 4 wuerawdata=/fact/raw 4 source `dirname $0`/../Sourcefile.sh 5 printprocesslog "INFO starting $0" 6 program=RsyncRawToWue 7 step=RawFileAvailWue 5 8 6 today=`date +%F-%H-%M-%S` 7 logfile=~/DataCheck/log/BackupRawToWue$today.log 9 set -C 8 10 9 echo "" >> $logfile 2>&1 10 echo "" >> $logfile 2>&1 11 echo "" >> $logfile 2>&1 12 echo `date`": start rsync of raw data to Wuerzburg" >> $logfile 2>&1 11 logfile=$runlogpath"/RsyncRawToWue-"$datetime".log" 12 date >> $logfile 13 13 14 #rsync from ISDC to Wue DC 15 if ! /usr/bin/rsync -avx --no-p --progress $isdcrawdata operator@coma.astro.uni-wuerzburg.de:$wuerawdata >> $logfile 2>&1 16 then 17 echo `date`": problem rsyncing rawdata from ISDC ("$HOST") to Wuerzburg" 18 fi 14 # check if script is already running 15 lockfile=$lockpath/lock-$program.txt 16 checklock 17 18 # get todo list 19 gettodo 19 20 20 21 22 for (( s=0 ; s < $num ; s++ )) 23 do 24 night=${primaries[$s+$s]} 25 runid=${primaries[$s+$s+1]} 26 nightpath=`echo $night | cut -c 1-4`"/"`echo $night | cut -c 5-6`"/"`echo $night | cut -c 7-8` 27 28 setstatus "start" 29 30 rawfileisdc="/scratch/from_lapalma/raw/./"$nightpath"/"$night"_"`printf %03d $runid`".fits.gz" 31 rawdirwue="/fact/raw/" 32 33 printprocesslog "INFO rsync rawfile "$rawfileisdc" to Wue "$rawdirwue 34 #rsync -rltDvR --partial --stats --password-file=/home_nfs/isdc/fact_opr/rsync.pwd factdata@161.72.93.131::$rawfilelp $rawdirisdc >> $logfile 2>&1 35 rsync -avxR --no-p --stats $rawfileisdc operator@coma.astro.uni-wuerzburg.de:$rawdirwue >> $logfile 2>&1 36 check1=$? 37 38 case $check1 in 39 0) printprocesslog "INFO rawfile "$rawfileisdc" transferred successfully to Wue." 40 ;; 41 *) printprocesslog "WARN "$rawfileisdc" could not be transferred to Wue." 42 check=$check1 43 ;; 44 esac 45 46 47 setstatus "stop" 48 done 49 50 finish 51
Note:
See TracChangeset
for help on using the changeset viewer.