Changeset 12971
- Timestamp:
- 02/29/12 13:15:36 (13 years ago)
- Location:
- trunk/DataCheck
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/RsyncAux.sh
r12876 r12971 1 1 #!/bin/bash 2 2 3 today=`date +%F` 4 logfile=/home/`whoami`/DataCheck/log/RsyncAux$today.log 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 echo "" >> $logfile 2>&1 7 echo "" >> $logfile 2>&1 8 echo "" >> $logfile 2>&1 6 source `dirname $0`/Sourcefile.sh 7 printprocesslog "INFO starting "$0 8 9 logfile=$runlogpath"/RsyncAuxLP-"$datetime".log" 10 date >> $logfile 9 11 10 12 # check if /daq is mounted on data 11 13 if ! mount | grep daq >> $logfile 2>&1 12 14 then 13 echo "/daq is not mounted on data => please mount it" 14 exit 15 printprocesslog "ERROR /daq is not mounted on data => please mount it" 16 echo `date`": /daq is not mounted on data => please mount it" 17 finish 15 18 fi 19 20 # check if paths are available 21 if ! ls /daq/aux >/dev/null 2>&1 22 then 23 printprocesslog "ERROR /daq/aux is not available." 24 finish 25 fi 26 if ! ls /loc_data/aux >/dev/null 2>&1 27 then 28 printprocesslog "ERROR /loc_data/aux is not available." 29 finish 30 fi 31 16 32 17 33 # get last 3 nights … … 26 42 if ! [ -d $auxdirdaq ] 27 43 then 44 printprocesslog "WARN "$auxdirdaq" not found. Data were probably taken on data" >> $logfile 2>&1 28 45 echo `date`": "$auxdirdaq" not found. Data were probably taken on data" >> $logfile 2>&1 29 46 continue … … 34 51 mkdir -pv $auxdirdata >> $logfile 2>&1 35 52 fi 53 printprocesslog "INFO processing files in "$auxdirdaq >> $logfile 2>&1 36 54 echo `date`": processing files in "$auxdirdaq >> $logfile 2>&1 37 55 … … 43 61 # limit bw for rsync to 20 MB/s during night 44 62 bwlimit="--bwlimit=20000" 63 printprocesslog "INFO rsync data with "$bwlimit >> $logfile 2>&1 45 64 echo "rsync data with "$bwlimit >> $logfile 2>&1 46 65 else 47 66 # no bw limit during day 67 printprocesslog "INFO rsync data without bwlimit" >> $logfile 2>&1 48 68 echo "rsync data without bwlimit" >> $logfile 2>&1 49 69 fi … … 53 73 if ! /usr/bin/rsync -avxHP $bwlimit $auxdirdaq $auxdirdata >> $logfile 2>&1 54 74 then 75 printprocesslog "WARN problem rsyncing auxiliary data for "$date" from daq to data" 55 76 echo `date`": problem rsyncing auxiliary data for "$date" from daq to data" 56 77 fi -
trunk/DataCheck/RsyncRaw.sh
r12876 r12971 1 1 #!/bin/bash 2 2 3 today=`date +%F` 4 logfile=/home/`whoami`/DataCheck/log/RsyncRaw$today.log 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 echo "" >> $logfile 2>&1 7 echo "" >> $logfile 2>&1 8 echo "" >> $logfile 2>&1 6 source `dirname $0`/Sourcefile.sh 7 printprocesslog "INFO starting "$0 8 9 logfile=$runlogpath"/RsyncRawLP-"$datetime".log" 10 date >> $logfile 9 11 10 12 # check if /daq is mounted on data 11 13 if ! mount | grep daq >> $logfile 2>&1 12 14 then 13 echo "/daq is not mounted on data => please mount it" 14 exit 15 printprocesslog "ERROR /daq is not mounted on data => please mount it" 16 echo `date`": /daq is not mounted on data => please mount it" 17 finish 18 fi 19 20 # check if paths are available 21 if ! ls /daq/raw >/dev/null 2>&1 22 then 23 printprocesslog "ERROR /daq/raw is not available." 24 finish 25 fi 26 if ! ls /loc_data/raw >/dev/null 2>&1 27 then 28 printprocesslog "ERROR /loc_data/raw is not available." 29 finish 15 30 fi 16 31 … … 27 42 then 28 43 echo `date`": "$rawdirdaq" not found. Data were probably taken on data" >> $logfile 2>&1 44 printprocesslog "WARN "$rawdirdaq" not found. Data were probably taken on data" >> $logfile 2>&1 29 45 continue 30 46 fi … … 34 50 mkdir -pv $rawdirdata >> $logfile 2>&1 35 51 fi 52 printprocesslog "INFO processing files in "$rawdirdaq >> $logfile 2>&1 36 53 echo `date`": processing files in "$rawdirdaq >> $logfile 2>&1 37 54 … … 43 60 # limit bw for rsync to 20 MB/s during night 44 61 bwlimit="--bwlimit=20000" 62 printprocesslog "INFO rsync data with "$bwlimit >> $logfile 2>&1 45 63 echo "rsync data with "$bwlimit >> $logfile 2>&1 46 64 else 47 65 # no bw limit during day 66 printprocesslog "INFO rsync data without bwlimit" >> $logfile 2>&1 48 67 echo "rsync data without bwlimit" >> $logfile 2>&1 49 68 fi … … 53 72 if ! /usr/bin/rsync -avxHP $bwlimit $rawdirdaq $rawdirdata >> $logfile 2>&1 54 73 then 74 printprocesslog "WARN problem rsyncing rawdata for "$date" from daq to data" 55 75 echo `date`": problem rsyncing rawdata for "$date" from daq to data" 56 76 fi 57 77 done 58 78 79 finish 59 80
Note:
See TracChangeset
for help on using the changeset viewer.