source: trunk/DataCheck/Transfer/RsyncAuxToISDC.sh@ 18403

Last change on this file since 18403 was 18397, checked in by Daniela Dorner, 9 years ago
removed wrong comment
  • Property svn:executable set to *
File size: 2.2 KB
Line 
1#!/bin/bash
2
3source `dirname $0`/../Sourcefile.sh
4printprocesslog "INFO starting "$0
5
6logfile=$runlogpath"/RsyncAuxToISDC-"$datetime".log"
7date >> $logfile
8
9# get dates
10if [ "$certaindate" != "" ]
11then
12 getdates $certaindate
13else
14 # get all night
15 #getdates "all"
16 # get last 9 nights
17 getdates 9
18fi
19
20
21
22# do rsync for rawfiles of these dates
23for date in ${dates[@]}
24do
25 echo "" >> $logfile 2>&1
26 echo $date >> $logfile 2>&1
27 # auxiliary data directories
28 auxdirlp=/loc_data/aux/./$date/
29 auxdirisdc=/scratch/from_lapalma/aux
30
31 printprocesslog "INFO processing files in "$auxdirlp >> $logfile 2>&1
32 echo `date`": processing files in "$auxdirlp >> $logfile 2>&1
33
34 # get current hour
35 hour=`date +%k`
36 # define bwlimit for rsync depending on the time: from 19-7h reduced bwlimit for rsync
37 if [ $hour -le 14 ] || [ $hour -ge 13 ]
38 then
39 # use once a day the -c option
40 # normally files are compared by size and time
41 # but for the daily files the size doesn't change when TSTOP is added
42 # due to the one hour time difference it could happen that rsync
43 # doesn't update the file when only checking time and size
44 # run with this option after lunch (LP time)
45 option="-c"
46 printprocesslog "INFO rsync data with option "$option >> $logfile 2>&1
47 echo "rsync data with option "$option >> $logfile 2>&1
48 else
49 # no extra option
50 printprocesslog "INFO rsync data without extra option" >> $logfile 2>&1
51 echo "rsync data without extra option" >> $logfile 2>&1
52 fi
53
54 if ! ssh fact@161.72.93.131 "ls $auxdirlp >/dev/null 2>&1"
55 then
56 printprocesslog "INFO "$auxdirlp" not available on data. "
57 continue
58 fi
59
60 #rsync from daq to data
61 #if ! /usr/bin/rsync -avxHPu $bwlimit $auxdirdaq $auxdirdata >> $logfile 2>&1 # in case of adding checksum, only update files with rsync
62 if ! rsync -rltDvR -T $rsynctempdir --stats fact@161.72.93.131:$auxdirlp $auxdirisdc >> $logfile 2>&1
63 then
64 printprocesslog "CONNECTION problem rsyncing auxiliary data for "$date" from La Palma to ISDC"
65 echo `date`": problem rsyncing auxiliary data for "$date" from La Palma to ISDC" >> $logfile 2>&1
66 fi
67done
68
Note: See TracBrowser for help on using the repository browser.