Skip to content
Snippets Groups Projects
Commit f384b5b2 authored by Yan Grange's avatar Yan Grange :wave:
Browse files

SDC-45: Movescript is ready

parent 80d712a7
No related branches found
No related tags found
No related merge requests found
rucio-client.simg
source_data_list.dat
data_movescript.sh
datapaths.pck
#!/usr/bin/env python
import os
from rucio.rse.protocols import protocol
import cPickle as pickle
def data_parser(filedata, scope='lofar'):
datafiles = list()
......@@ -32,15 +33,17 @@ scope = 'lofar'
srm_root_host = "srm://srm.grid.sara.nl"
rucio_rse_rootdir = "srm://srm.grid.sara.nl/pnfs/grid.sara.nl/data/escape/disk/rucio/sara_dcache"
rdt = protocol.RSEDeterministicTranslation()
move_commands = list()
topaths = list()
for frompath in filepaths:
fname = os.path.basename(frompath)
tosubpath = rdt.path(scope,fname)
from_address = "/".join([srm_root_host, frompath])
to_address = "/".join([rucio_rse_rootdir, tosubpath])
print("srmmv {src} {tgt}".format(src=from_address, tgt=to_address))
topaths.append(to_address)
move_commands.append("srmmv {src} {tgt}".format(src=from_address, tgt=to_address))
with open("data_movescript.sh", 'w') as dms:
dms.writelines(move_commands)
# step 4: Add replicas for files using rucio.client.replicaclient the ReplicaClient class (add_replicas)
# step 4: Add dataset for each observation, add the files to the dataset
# step 5: Add container and add the cal/tgt to the container together
with open("datapaths.pck","wb") as path_pickle:
pickle.dump(topaths, path_pickle)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment