Do glob patterns work for remote copy lists?

Hi everyone,
I would implemented something on the line:

calc_info.remote_copy_list[(self.inputs.parent_folder.computer.uuid, 'restart_*', None)]

As I might not know the name of the file. Would this example work?
Otherwise i guess i might dynamically look into the remote tree and pick the names, although less convenient.
Thanks a lot for any pointer!

I think that should be possible but not a 100% sure. Looking at the source code here

we can see the remote_copy_list items are passed to Transport.copy which in turn seems to support globs in the source:

Why don’t you give it a try?

Thanks Sebastiaan! I tried it out but unfortunately it doesn’t work, as it requires to specify 3 strings (so None is not accepted), and at the same time it doesn’t accept glob patterns for the last string (as it stop throwing out a related error saying that). I am working with aiida-core v2.3.1, so don’t know if there is any new functionality that allows to do so - otherwise, it seems that one cannot use wildcards for the remote copy list right now.

Did you try to specify a folder for the last (destination) path, as you would do with cp? Try with a subfolder of the scratch that you should create beforehand (this should work, I think?) and then also with . if you want to copy in to the main scratch folder of the job (there is a small probability that the latter does not work, in which case it’s a bug and we should fix it).

Thanks @giovannipizzi ! It did work using .

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.