Ignore:
Timestamp:
02/29/12 13:15:36 (13 years ago)
Author:
Daniela Dorner
Message:
introduced usage of global logfile
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/RsyncRaw.sh

    r12876 r12971  
    11#!/bin/bash
    22
    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
    55
    6 echo "" >> $logfile 2>&1
    7 echo "" >> $logfile 2>&1
    8 echo "" >> $logfile 2>&1
     6source `dirname $0`/Sourcefile.sh
     7printprocesslog "INFO starting "$0
     8
     9logfile=$runlogpath"/RsyncRawLP-"$datetime".log"
     10date >> $logfile
    911
    1012# check if /daq is mounted on data
    1113if ! mount | grep daq >> $logfile 2>&1
    1214then
    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
     18fi
     19
     20# check if paths are available
     21if ! ls /daq/raw >/dev/null 2>&1
     22then
     23   printprocesslog "ERROR /daq/raw is not available."
     24   finish
     25fi
     26if ! ls /loc_data/raw >/dev/null 2>&1
     27then
     28   printprocesslog "ERROR /loc_data/raw is not available."
     29   finish
    1530fi
    1631
     
    2742   then
    2843      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
    2945      continue
    3046   fi
     
    3450      mkdir -pv $rawdirdata >> $logfile 2>&1
    3551   fi
     52   printprocesslog "INFO processing files in "$rawdirdaq >> $logfile 2>&1
    3653   echo `date`": processing files in "$rawdirdaq >> $logfile 2>&1
    3754
     
    4360      # limit bw for rsync to 20 MB/s during night
    4461      bwlimit="--bwlimit=20000"
     62      printprocesslog "INFO rsync data with "$bwlimit >> $logfile 2>&1
    4563      echo "rsync data with "$bwlimit >> $logfile 2>&1
    4664   else
    4765      # no bw limit during day
     66      printprocesslog "INFO rsync data without bwlimit" >> $logfile 2>&1
    4867      echo "rsync data without bwlimit" >> $logfile 2>&1
    4968   fi
     
    5372   if ! /usr/bin/rsync -avxHP $bwlimit $rawdirdaq $rawdirdata >> $logfile 2>&1
    5473   then
     74      printprocesslog "WARN problem rsyncing rawdata for "$date" from daq to data"
    5575      echo `date`": problem rsyncing rawdata for "$date" from daq to data"
    5676   fi
    5777done
    5878
     79finish
    5980
Note: See TracChangeset for help on using the changeset viewer.