# (the local chache location and paths can be manipulated.)
# - needs a configured config file (by default alienSync.config)
# and a working alien environment (token and at least $ALIEN_DIR or $ALIEN_ROOT set)
+# - can be also used without a config file
+#
+# run the script without argument to see the examples
#
# origin: Mikolaj Krzewicki, mikolaj.krzewicki@cern.ch
#
return
fi
+ #be nice and allow group members access as well (002 will create dirs with 775 and files with 664)
+ umask 0002
+
# try to load the config file
#[[ ! -f $1 ]] && echo "config file $1 not found, exiting..." | tee -a $logFile && exit 1
if ! parseConfig "$@"; then return 1; fi
echo ""|tee -a $logFile
echo log: $logFile
- #be nice and allow group members access as well (002 will create dirs with 775 and files with 664)
- umask 0002
-
#lock
lockFile=$logOutputPath/runningNow.lock
[[ -f $lockFile && ${allowConcurrent} -ne 1 ]] && echo "locked. Another process running? ($lockFile)" | tee -a $logFile && exit 1
#fi
export copyMethod
- export copyScript
export copyTimeout
export copyTimeoutHard
echo copyFromAlien "$alienFile" "$tmpdestination"
[[ -n ${MAILTO} ]] && echo $logFile | mail -s "alienSync ${alienFindCommand} done" ${MAILTO}
- echo
- echo
- echo '###############################'
- echo "eval ${executeEnd}"
- eval "${executeEnd}"
+ if [[ -n ${executeEnd} ]]; then
+ echo
+ echo
+ echo '###############################'
+ echo "eval ${executeEnd}"
+ eval "${executeEnd}"
+ fi
exitScript 0
}
dst=$2
if [[ "$copyMethod" == "tfilecp" ]]; then
if which timeout &>/dev/null; then
- echo timeout $copyTimeout root -b -q "$copyScript(\"$src\",\"$dst\")"
- timeout $copyTimeout root -b -q "$copyScript(\"$src\",\"$dst\")"
+ echo timeout $copyTimeout "TFile::Cp(\"$src\",\"$dst\")"
+ timeout $copyTimeout root -b <<EOF
+TGrid::Connect("alien://");
+TFile::Cp("${src}","${dst}");
+EOF
+
else
- echo root -b -q "$copyScript(\"$src\",\"$dst\")"
- root -b -q "$copyScript(\"$src\",\"$dst\")"
+ echo "TFile::Cp(\"$src\",\"$dst\")"
+ root -b <<EOF
+TGrid::Connect("alien://");
+TFile::Cp("${src}","${dst}");
+EOF
fi
else
if which timeout &>/dev/null; then
#things that by default depend on other variables should be set here, after the dependencies
[[ -z ${logOutputPath} ]] && logOutputPath="${localPathPrefix}/alienSyncLogs"
+ return 0
}
checkMD5sum()