]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adding little tool macro to down load a CDB snapshot for a run
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Mar 2011 17:23:45 +0000 (17:23 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Mar 2011 17:23:45 +0000 (17:23 +0000)
HLT/programs/downloadCDB.C [new file with mode: 0644]

diff --git a/HLT/programs/downloadCDB.C b/HLT/programs/downloadCDB.C
new file mode 100644 (file)
index 0000000..e6aab04
--- /dev/null
@@ -0,0 +1,43 @@
+// $Id$
+///
+/// @file downloadCDB.C
+/// @brief Download a snapshot of the CDB to another folder
+///
+/// <pre>
+/// Usage: aliroot -b -q -l \
+///     downloadCDB.C'(runno, "from", "to", "path")'
+///
+/// Examples:
+///     downloadCDB.C'(144991, "alien://folder=/alice/data/2011/OCDB", "local:///tmp/144991/OCDB")'
+///
+/// Defaults
+///     path="*/*/*"  -> download everything
+///
+/// </pre>
+///
+///
+void downloadCDB(Int_t runnr,
+      const char* from,
+      const char* to,
+      const char* path="*/*/*") 
+{
+  AliCDBManager* man=AliCDBManager::Instance();
+  man->SetDefaultStorage(from);
+  man->SetDrain(to);
+  AliCDBPath cdbpath(path);
+  man->GetAll(path, runnr);
+}
+
+void downloadCDB()
+{
+  cout << " Usage:" << endl;
+  cout << "   aliroot -b -q -l \\" << endl;
+  cout << "     downloadCDB.C'(runno, \"from\", \"to\", \"path\")'" << endl;
+  cout << "" << endl;
+  cout << " Examples:" << endl;
+  cout << "   aliroot -b -q -l \\" << endl;
+  cout << "     downloadCDB.C'(144991, \"alien://folder=/alice/data/2011/OCDB\", \"local:///tmp/144991/OCDB\")'" << endl;
+  cout << "" << endl;
+  cout << " Defaults" << endl;
+  cout << "     path=\"*/*/*\"  -> download everything" << endl;
+}