-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopyN08.sh
executable file
·66 lines (49 loc) · 1.18 KB
/
copyN08.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
##########################################
#
# Paths and routes
#
##########################################
# paths and conf
source $HOME/gutta.conf
##########################################
#
# Load utils
#
##########################################
source ${OP_PATH}/utils.sh
##########################################
#
# Start doing things...
#
##########################################
# set folder for copy
SRC=$SRCLINK/${1}/$SRCAPPEND
echo "SOURCE PATH: $SRC"
# set destination folder
DST=$N08BASE/${1}/$N08APPEND
echo "DESTINATION PATH: $DST"
##########################################
#
# Link
#
##########################################
# create a local link
echo "Moving to $DATAPRODUCTS"
cd ${DATAPRODUCTS}
echo "I'm in ${DATAPRODUCTS}"
echo "Removing link..."
rm ${DATAPRODUCTS}/latestProduction
echo "Creating link..."
ln -sf ${1} latestProduction -v
##########################################
#
# Copy
#
##########################################
if [[ $COPY -ne 0 ]]; then
# create the destination folder if it does not exist
ssh $N08ADDR "mkdir -p ${N08BASE}/${1}/AdriaticSea_nu04_inv012_T07/"
# copy files
scp -r ${SRC} ${DST}
fi