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

Last change on this file since 19651 was 18856, checked in by Daniela Dorner, 8 years ago
updated for newdata as download machine in LP
  • 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 ;;
31 newdata) from=( "/data1/analysis" )
32 to=( "newdaq:/loc_data/analysis_bu" )
33 ;;
34 isdc-dl00) from=( "fact@161.72.93.138:/data1/analysis" "/gpfs0/fact/processing/qla" )
35 #to="/gpfs/scratch/fact/qla"
36 to=( "/gpfs0/fact/processing/qla" "operator@coma.astro.uni-wuerzburg.de:/fact/data/qla")
37 # for new rsync: update variables
38 ;;
39 *) echo "no valid host "$HOSTNAME
40 exit
41 ;;
42esac
43
44
45
46for (( i=0 ; i < ${#from[@]} ; i++ ))
47do
48 if [ ${#dirs[@]} -gt 0 ]
49 then
50 for dir in ${dirs[@]}
51 do
52 printprocesslog "INFO rsync "${from[$i]}$dir"/ to "${to[$i]}$dir
53 echo "rsync from "${from[$i]}$dir"/ to "${to[$i]}$dir >> $logfile 2>&1
54 if ! rsync -auv ${from[$i]}$dir"/" ${to[$i]}$dir >> $logfile 2>&1
55 then
56 printprocesslog "CONNECTION problem rsyncing QLA from "${from[$i]}$dir"/ to "${to[$i]}$dir
57 echo `date`": problem rsyncing QLA from "${from[$i]}$dir"/ to "${to[$i]}$dir >> $logfile 2>&1
58 fi
59 done
60 else
61 printprocesslog "INFO rsync "${from[$i]}"/ to "${to[$i]}
62 echo "rsync from "${from[$i]}"/ to "${to[$i]} >> $logfile 2>&1
63 if ! rsync -auv ${from[$i]}"/" ${to[$i]} >> $logfile 2>&1
64 then
65 printprocesslog "CONNECTION problem rsyncing QLA from "${from[$i]}"/ to "${to[$i]}
66 echo `date`": problem rsyncing QLA from "${from[$i]}"/ to "${to[$i]} >> $logfile 2>&1
67 fi
68 fi
69done
70
71finish >> $logfile 2>&1
72
Note: See TracBrowser for help on using the repository browser.