source: trunk/DataCheck/RsyncRaw.sh@ 12576

Last change on this file since 12576 was 12576, checked in by Daniela Dorner, 13 years ago
changed to new structure (nfs mount of disk); bugfix
  • Property svn:executable set to *
File size: 907 bytes
Line 
1#!/bin/bash
2
3date=`date +%Y/%m/%d --date="-1day"`
4
5today=`date +%F`
6logfile=/home/`whoami`/DataCheck/log/RsyncRaw$today.log
7
8echo "" >> $logfile 2>&1
9echo "" >> $logfile 2>&1
10echo "" >> $logfile 2>&1
11# raw data directories on data
12rawdirdaq=/daq/raw/$date/ # /loc_data from daq via nfs on data
13rawdirdata=/loc_data/raw/$date
14echo `date`": processing files in "$rawdir >> $logfile 2>&1
15
16# get current hour
17hour=`date +%k`
18# define bwlimit for rsync depending on the time
19if [ $hour -lt 8 ] || [ $hour -gt 18 ]
20then
21 # limit bw for rsync to 20 MB/s during night
22 bwlimit="--bwlimit=20000"
23 echo "rsync data with "$bwlimit >> $logfile 2>&1
24else
25 # no bw limit during day
26 echo "rsync data without bwlimit" >> $logfile 2>&1
27fi
28
29#rsync from daq to data
30if ! /usr/bin/rsync -avxHP $bwlimit $rawdirdaq $rawdirdata >> $logfile 2>&1
31then
32 echo `date`": problem rsyncing rawdata from daq to data"
33fi
34
35
Note: See TracBrowser for help on using the repository browser.