Skip to content
Snippets Groups Projects
Commit f10176e3 authored by Manuela Kuhn's avatar Manuela Kuhn
Browse files

Condensed file copy loops for cbf and tif

parent 89a94a09
No related branches found
No related tags found
No related merge requests found
File added
#/bin/sh
BASEPATH=/space/projects/live-viewer
#BASEPATH=/home/p11user/live-viewer
TARGET=${BASEPATH}/data/source/local
LIMIT=10
usage() { echo "Usage: $0 [-f <cbf|tif>] [-t <targetpath>] [-n <number of files>]" 1>&2; exit 1; }
while getopts ':f:t:n:' OPTION ; do
case "${OPTION}" in
f) FORMAT=${OPTARG}
if [ "${FORMAT}" != "cbf" ] && [ "${FORMAT}" != "tif" ]; then usage; fi
# ((${FORMAT} == "cbf" || ${FORMAT} == "tif")) || usage
;;
t) TARGET=${OPTARG}
if [ ! -d ${TARGET} ]; then echo "${TARGET} does not exist"; exit 1; fi
;;
n) LIMIT=${OPTARG}
if echo ${LIMIT} | grep -q '^[0-9]+$'; then echo "${LIMIT} is not a number"; exit 1; fi
;;
*) usage
esac
done
shift $((OPTIND-1))
#if [ -z "${t}" ] || [ -z "${p}" ]; then
if [ -z "${FORMAT}" ]; then
usage
fi
case "${FORMAT}" in
cbf) FILES=${BASEPATH}/test_015_00001.cbf ;;
tif) FILES=${BASEPATH}/bf_00000.tif
esac
i=1
while [ "$i" -le $LIMIT ]
do
TARGET_FILE="$TARGET/$i.$FORMAT"
echo $TARGET_FILE
cp $FILES "$TARGET_FILE"
i=$(($i+1))
done
#/bin/sh
#BASEPATH=/space/projects/live-viewer
BASEPATH=/home/p11user/live-viewer
FILES=${BASEPATH}/test_015_00001.cbf
#FILES=/tmp/PhilipPBS_3_00001.cbf
#TARGET=${BASEPATH}/data/source/local
TARGET=/rd_temp/local/sender_test
i=1
LIMIT=1000
while [ "$i" -le $LIMIT ]
do
TARGET_FILE="$TARGET/$i.cbf"
echo $TARGET_FILE
cp $FILES "$TARGET_FILE"
# sleep 0.2
i=$(($i+1))
done
#/bin/sh
FILES=/space/projects/test_data/flat/bf_00000.tif
TARGET=/space/projects/live-viewer/data/source/local
i=1
LIMIT=1000
while [ "$i" -le $LIMIT ]
do
TARGET_FILE="$TARGET/$i.tif"
echo $TARGET_FILE
cp $FILES "$TARGET_FILE"
i=$(($i+1))
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment