Commit 7b128e40 authored by thomas.forbriger's avatar thomas.forbriger

BFO2LSDF [FEATURE]: support rsync dry-run

parent 503ff308
......@@ -29,6 +29,9 @@
# - re-establish VPN tunnel for each directory
# 15/05/2016 V1.6 add subdirectory for long term archive of
# experiments
# 02/09/2016 V1.7 make program fit for bromo:
# - support dry-run
# - use openvpn instead of vpnc
#
# ============================================================================
#
......@@ -37,6 +40,8 @@ TUN_INTERFACE=tun0
# approx. 80% of 256 kBit/second
BWLIMIT=20
EXCLUDE="--exclude='.lock'"
DRYRUN=
DRYRUN=--dry-run
BFO_BASEDIR=/media/BFO_archive
#LSDF_BASEDIR=\
#gpi-lsdf-seis-0001@gpilsdf.gpi.uni-karlsruhe.de:/home/gpi-lsdf-seis-0001/LSDF/SEIS/projects/BFO
......@@ -107,16 +112,22 @@ do
fi
fi
if test "$DRYRUN" = "--dry-run"
then
${LOGGER} -i -p user.info "${LOGINFO} \
dry-run of copy operation (i.e. files are not actually copied)"
fi
# copy data (compressed)
${LOGGER} -i -p user.info "${LOGINFO}\
${RSYNC} -v -z -a --protocol=29 --bwlimit ${BWLIMIT} ${EXCLUDE} \
-e \"${SSHCMD}\" \
-e \"${SSHCMD}\" $DRYRUN \
--backup --suffix=$(date +'%Y%m%d%H%M') \
${EXCLUDE_PATTERNS[$i]} ${BFO_BASEDIR}/${DATADIRS[$i]} \
${LSDF_BASEDIR}/${DATADIRS[$i]}"
set -o pipefail
${RSYNC} -v -z -a --protocol=29 --bwlimit ${BWLIMIT} ${EXCLUDE} \
-e "${SSHCMD}" \
-e "${SSHCMD}" $DRYRUN \
--backup --suffix=$(date +'%Y%m%d%H%M') \
${EXCLUDE_PATTERNS[$i]} ${BFO_BASEDIR}/${DATADIRS[$i]} \
${LSDF_BASEDIR}/${DATADIRS[$i]} \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment