Changeset 13054 for trunk


Ignore:
Timestamp:
03/09/12 22:18:35 (13 years ago)
Author:
Daniela Dorner
Message:
reworked version of scripts doing backup to Wuerzburg
Location:
trunk/DataCheck/Transfer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/Transfer/BackupAuxToWue.sh

    r13046 r13054  
    11#!/bin/bash
    22
    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
    55
    6 today=`date +%F-%H-%M-%S`
    7 logfile=~/DataCheck/log/BackupAuxToWue$today.log
     6source `dirname $0`/../Sourcefile.sh
     7printprocesslog "INFO starting "$0
    88
    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
     9logfile=$runlogpath"/RsyncAuxToWue-"$datetime".log"
     10date >> $logfile
    1311
    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
     13dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` )
    1914
     15# do rsync for rawfiles of these dates
     16for date in ${dates[@]}
     17do
     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
     38done
    2039
  • trunk/DataCheck/Transfer/BackupRawToWue.sh

    r13046 r13054  
    1 #!/bin/bash
     1#!/bin/sh
     2#
    23
    3 isdcrawdata=/data00/fact-construction/raw/
    4 wuerawdata=/fact/raw
     4source `dirname $0`/../Sourcefile.sh
     5printprocesslog "INFO starting $0"
     6program=RsyncRawToWue
     7step=RawFileAvailWue
    58
    6 today=`date +%F-%H-%M-%S`
    7 logfile=~/DataCheck/log/BackupRawToWue$today.log
     9set -C
    810
    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
     11logfile=$runlogpath"/RsyncRawToWue-"$datetime".log"
     12date >> $logfile
    1313
    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
     15lockfile=$lockpath/lock-$program.txt
     16checklock
     17
     18# get todo list
     19gettodo
    1920
    2021
     22for (( s=0 ; s < $num ; s++ ))
     23do
     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"
     48done
     49
     50finish
     51
Note: See TracChangeset for help on using the changeset viewer.