Downloading all QC plot .root files from a handful of runs

I need to download all the QC plots .root files from a handful of runs (526174 529039 529403 529418 538964 542756 544434 545345 551685 551729) generated by the tasks QcZDCTask and QcZDCRecTask of the ALICE-ZDC detector.
I know how to download a single plot from the qcdb, but doing it one by one would take ages.
It was suggested to me that a script should do the trick, however I have no idea how to do it.
Could anyone help me with that?
Thank you very much,

@grigoras Could you provide an example on how to download a file from CCDB/QCDB using curl ?

Maybe it can be of use: have the -input argument that take a file with a list (per line) of src dst pairs
Then you can do something like: cp -retry 2 -parent 99 -input my_list_of_files
-parent will keep last N components of the path when copy the src to dst, so -parent 99 will keep the full path of the src when copy to dst (so on disk you will have dst/src filepath)


With curl you can request the list of objects for a run, in a machine-friendly format like JSON and iterate over the files. The content itself is also available over HTTP so it can be fetched again with curl. Putting the two together in an example command:

curl -s '*/RunNumber=526174?Accept=application/json' | \
jq -r '.objects[] | "curl\(.replicas[0]) -o \(.path|split("/")|join("_"))_\(.RunNumber).root"'

would give you the list of commands to run to fetch each of these objects locally, with a name you can customize. For the example above the generated commands are like:

curl -o qc_ZDC_MO_QcZDCRecTask_h_TDC_ZPC_TC_A_526174.root

If you are happy with these commands, run them all.



It works perfectly! Thank you!!