Changeset 12971 for trunk


Ignore:
Timestamp:
02/29/12 13:15:36 (13 years ago)
Author:
Daniela Dorner
Message:
introduced usage of global logfile
Location:
trunk/DataCheck
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/RsyncAux.sh

    r12876 r12971  
    11#!/bin/bash
    22
    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
    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"/RsyncAuxLP-"$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
    1518fi
     19
     20# check if paths are available
     21if ! ls /daq/aux >/dev/null 2>&1
     22then
     23   printprocesslog "ERROR /daq/aux is not available."
     24   finish
     25fi
     26if ! ls /loc_data/aux >/dev/null 2>&1
     27then
     28   printprocesslog "ERROR /loc_data/aux is not available."
     29   finish
     30fi
     31
    1632
    1733# get last 3 nights
     
    2642   if ! [ -d $auxdirdaq ]
    2743   then
     44      printprocesslog "WARN "$auxdirdaq" not found. Data were probably taken on data" >> $logfile 2>&1
    2845      echo `date`": "$auxdirdaq" not found. Data were probably taken on data" >> $logfile 2>&1
    2946      continue
     
    3451      mkdir -pv $auxdirdata >> $logfile 2>&1
    3552   fi
     53   printprocesslog "INFO processing files in "$auxdirdaq >> $logfile 2>&1
    3654   echo `date`": processing files in "$auxdirdaq >> $logfile 2>&1
    3755   
     
    4361      # limit bw for rsync to 20 MB/s during night
    4462      bwlimit="--bwlimit=20000"
     63      printprocesslog "INFO rsync data with "$bwlimit >> $logfile 2>&1
    4564      echo "rsync data with "$bwlimit >> $logfile 2>&1
    4665   else
    4766      # no bw limit during day
     67      printprocesslog "INFO rsync data without bwlimit" >> $logfile 2>&1
    4868      echo "rsync data without bwlimit" >> $logfile 2>&1
    4969   fi
     
    5373   if ! /usr/bin/rsync -avxHP $bwlimit $auxdirdaq $auxdirdata >> $logfile 2>&1
    5474   then
     75      printprocesslog "WARN problem rsyncing auxiliary data for "$date" from daq to data"
    5576      echo `date`": problem rsyncing auxiliary data for "$date" from daq to data"
    5677   fi
  • 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.