]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGPP/QA/scripts/alienSync.sh
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGPP / QA / scripts / alienSync.sh
index 9de33b1dce55f91b479608aceb6683cbb431c463..92aa5f2429c44a5a33b209b629db69be678d6e29 100755 (executable)
@@ -6,6 +6,9 @@
 #    (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
 #
@@ -233,7 +236,6 @@ main()
     #fi
     
     export copyMethod
-    export copyScript
     export copyTimeout
     export copyTimeoutHard
     echo copyFromAlien "$alienFile" "$tmpdestination"
@@ -343,11 +345,13 @@ main()
   
   [[ -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
 }
@@ -501,11 +505,18 @@ copyFromAlien()
   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
@@ -559,6 +570,7 @@ parseConfig()
 
   #things that by default depend on other variables should be set here, after the dependencies
   [[ -z ${logOutputPath} ]] && logOutputPath="${localPathPrefix}/alienSyncLogs"
+  return 0
 }
 
 checkMD5sum()