diff --git a/create_movescript.py b/create_movescript.py index 06f5d5132b5674a7331e18ce1c5f0a55f47ac01a..984aa44bb3d80c44847f72cb0829df6b38f06c9f 100755 --- a/create_movescript.py +++ b/create_movescript.py @@ -10,7 +10,7 @@ def data_parser(filedata, scope='lofar'): meta = {} if not len(filedata[-1].strip()): filedata.pop() - for idx in range(0,len(filedata),18): + for idx in range(lsblocklength,len(filedata),lsblocklength): # skip first because that is the dir itself fileprops = filedata[idx].strip().split() nbytes = int(fileprops[0].strip()) pth = fileprops[1] @@ -40,8 +40,8 @@ for frompath in filepaths: tosubpath = rdt.path(scope,fname) from_address = "/".join([srm_root_host, frompath]) to_address = "/".join([rucio_rse_rootdir, tosubpath]) - topaths.append(to_address) - move_commands.append("srmmv {src} {tgt}".format(src=from_address, tgt=to_address)) + topaths.append(tosubpath[len(scope)+1:]) # strip off scope and slash + move_commands.append("srmmv {src} {tgt}\n".format(src=from_address, tgt=to_address)) with open("data_movescript.sh", 'w') as dms: dms.writelines(move_commands) diff --git a/register_movedfiles.py b/register_movedfiles.py index de1711b3471b470d4bf93682ff216928e223d77a..673509a16254b1258f40e9e472c1147ccaf3953b 100755 --- a/register_movedfiles.py +++ b/register_movedfiles.py @@ -5,7 +5,7 @@ import cPickle as pickle # step 4: Add replicas for files using rucio.client.replicaclient the ReplicaClient class (add_replicas) with open("datapaths.pck", "rb") as pathfile: data_paths = pickle.load(pathfile) - + print(data_paths[2]) # step 4: Add dataset for each observation, add the files to the dataset