Docs/MirroringStdAncilFiles: mirror_anc_archer

File mirror_anc_archer, 1.2 KB (added by willie, 4 months ago)

Mirror the Met Office ancils to the RDF shared account

Line 
1#!/bin/bash
2#
3# Check if the ARCHER RDF is up and if so copy the ancillary files there.
4#
5# Added atmos/KGO on 16/Nov/2015
6#
7set -u
8
9SSH_ENV=$HOME/.ssh/environment.$(hostname)
10. $SSH_ENV > /dev/null 2>&1
11
12UMDIR=${UMDIR:-/projects/um1}
13
14# need this because the dir is auto-mounted on local machines
15cd /cray_hpc/projects/um1
16
17RDF=dtn02.rdf.ac.uk
18
19# temp file for ping
20PING_ERR=$(mktemp --tmpdir=$HOME/temp)
21
22
23# Check if the RDF is up
24ping -c 1 $RDF 1>/dev/null 2> $PING_ERR
25RC=$?
26if  [[ $RC != 0 ]] ; then
27  echo The RDF may be down:  $(cat $PING_ERR), return code $RC 1>&2
28  rm $PING_ERR
29  exit $RC
30else
31  rm $PING_ERR
32fi
33
34# Begin copying ancils
35cd  ancil
36rsync -avz --stats --exclude-from=$HOME/bin/rsync_excludes.txt --partial \
37             -e "ssh -qi $HOME/.ssh/id_rsa -o 'BatchMode yes'"  \
38             data wmcginty@$RDF:/nerc/n02/shared/ancil
39
40cd atmos
41
42anc_list="KGO e4_11001000_euro master n48e n96 n96e my_600360_nae \
43          m4_288360_uk ukv n320 n320e n216 n216e n512 n512e n768e n2004"
44for res in $anc_list
45do
46 rsync -avz --stats --exclude-from=$HOME/bin/rsync_excludes.txt --partial \
47            -e "ssh -qi $HOME/.ssh/id_rsa -o 'BatchMode yes'" \
48             $res wmcginty@$RDF:/nerc/n02/shared/ancil/atmos
49done