source: trunk/DataCheck/Transfer/BackupQLA.sh@ 18747

Last change on this file since 18747 was 18747, checked in by Daniela Dorner, 8 years ago
removed debugging output
  • Property svn:executable set to *
File size: 2.2 KB
Line 
1#!/bin/bash
2#
3# This script does a backup of the QLA results
4# It can be used in different location
5#
6# Be careful: do NOT use --delete as on daq callisto files are deleted
7#
8
9source `dirname $0`/../Sourcefile.sh
10printprocesslog "INFO starting $0"
11
12set -C
13
14logfile=$runlogpath"/BackupQLA-"$datetime".log"
15date > $logfile
16
17if [ "$1" = "short" ]
18then
19 dirs=( "/star" "/callisto" "/ganymed_run" )
20 printprocesslog "INFO run only short version of rsyncs for the directories "${dirs[@]}
21 echo "INFO run only short version of rsyncs for the directories "${dirs[@]} >> $logfile
22fi
23
24
25
26# get paths depending on host
27case $HOSTNAME in
28 daq) from=( "/loc_data/analysis" )
29 to=( "/newdaq/analysis_bu" )
30 ## new temporary solution with rsync-servers
31 #to="newdaq::newdaq/analysis_bu"
32 ;;
33 isdc-dl00) from=( "fact@161.72.93.131:/daq/analysis" "/gpfs0/fact/processing/qla" )
34 #to="/gpfs/scratch/fact/qla"
35 to=( "/gpfs0/fact/processing/qla" "operator@coma.astro.uni-wuerzburg.de:/fact/data/qla")
36 # for new rsync: update variables
37 ;;
38 *) echo "no valid host "$HOSTNAME
39 exit
40 ;;
41esac
42
43
44
45for (( i=0 ; i < ${#from[@]} ; i++ ))
46do
47 if [ ${#dirs[@]} -gt 0 ]
48 then
49 for dir in ${dirs[@]}
50 do
51 printprocesslog "INFO rsync "${from[$i]}$dir"/ to "${to[$i]}$dir
52 echo "rsync from "${from[$i]}$dir"/ to "${to[$i]}$dir >> $logfile 2>&1
53 if ! rsync -auv ${from[$i]}$dir"/" ${to[$i]}$dir >> $logfile 2>&1
54 then
55 printprocesslog "CONNECTION problem rsyncing QLA from "${from[$i]}$dir"/ to "${to[$i]}$dir
56 echo `date`": problem rsyncing QLA from "${from[$i]}$dir"/ to "${to[$i]}$dir >> $logfile 2>&1
57 fi
58 done
59 else
60 printprocesslog "INFO rsync "${from[$i]}"/ to "${to[$i]}
61 echo "rsync from "${from[$i]}"/ to "${to[$i]} >> $logfile 2>&1
62 if ! rsync -auv ${from[$i]}"/" ${to[$i]} >> $logfile 2>&1
63 then
64 printprocesslog "CONNECTION problem rsyncing QLA from "${from[$i]}"/ to "${to[$i]}
65 echo `date`": problem rsyncing QLA from "${from[$i]}"/ to "${to[$i]} >> $logfile 2>&1
66 fi
67 fi
68done
69
70finish >> $logfile 2>&1
71
Note: See TracBrowser for help on using the repository browser.