#!/usr/bin/env bash # Copy MC files in the current directory to the data handling system. # Assume that cataloging is done after the files are copied by the # script ran by Dmitri. # # (which is not true for stntuples) # # The file names should follow the CDF file naming conventions. # # example: copy_to_dh -d sewk00 -D /cdf/data01/sewk01 [-V] # # -V: debug-only mode - print but do not execute # # 2nd mode: running on FCDFDATA031: # # cd cdfopr; # copy_to_dh -i bewk0d/183530_184067.ftp #----------------------------------------------------------------------- export VERBOSE=0 export INPUT_DIR="" export INPUT_FILE="" export DATASET="" export CMD="" ftp_script=/var/tmp/a_$$.ftp #----------------------------------------------------------------------- usage() { echo usage: copy_to_dh -d sewk00 -D /cdf/data01/sewk01 [-V] } if [ .$1 == "." ] ; then usage ; exit 0 ; fi #----------------------------------------------------------------------- # create input script for FTP (do not forget to fix file attributes on # the destination node - by default they may be wrong!) # # call: create_ftp_script tmp_file_name #----------------------------------------------------------------------- create_ftp_script_1() { f=`echo $file | awk -F / '{print $NF}'` cat > $1 < $1 <