# Do glob patterns work for remote copy lists?

**URL:** <https://aiida.discourse.group/t/do-glob-patterns-work-for-remote-copy-lists/474>\
**Category:** General Usage\
**Created:** [October 9, 2024, 5:34pm UTC](https://aiida.discourse.group/t/do-glob-patterns-work-for-remote-copy-lists/474 "2024-10-09T17:34:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bastonero](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/bastonero/32/32_2.png) [@bastonero](https://aiida.discourse.group/u/bastonero)\
**Post date:** [October 9, 2024, 5:34pm UTC](https://aiida.discourse.group/t/do-glob-patterns-work-for-remote-copy-lists/474/1 "2024-10-09T17:34:36Z")

</div>

Hi everyone,  
I would implemented something on the line:

```auto
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!

---

<div class="post-metadata">

**Author:** ![sphuber](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/sphuber/32/6_2.png) [@sphuber](https://aiida.discourse.group/u/sphuber)\
**Post date:** [October 9, 2024, 6:15pm UTC](https://aiida.discourse.group/t/do-glob-patterns-work-for-remote-copy-lists/474/2 "2024-10-09T18:15:49Z")

</div>

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

> <https://github.com/aiidateam/aiida-core/blob/98ffc331d154cc7717861fde6c908ec510003926/src/aiida/engine/daemon/execmanager.py#L293>

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

> <https://github.com/aiidateam/aiida-core/blob/98ffc331d154cc7717861fde6c908ec510003926/src/aiida/transports/plugins/ssh.py#L1161>

Why don’t you give it a try?

---

<div class="post-metadata">

**Author:** ![bastonero](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/bastonero/32/32_2.png) [@bastonero](https://aiida.discourse.group/u/bastonero)\
**Post date:** [October 10, 2024, 8:21am UTC](https://aiida.discourse.group/t/do-glob-patterns-work-for-remote-copy-lists/474/3 "2024-10-10T08:21:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![giovannipizzi](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/giovannipizzi/32/17_2.png) [@giovannipizzi](https://aiida.discourse.group/u/giovannipizzi)\
**Post date:** [October 10, 2024, 9:40am UTC](https://aiida.discourse.group/t/do-glob-patterns-work-for-remote-copy-lists/474/4 "2024-10-10T09:40:49Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![bastonero](https://yyz2.discourse-cdn.com/free1/user_avatar/aiida.discourse.group/bastonero/32/32_2.png) [@bastonero](https://aiida.discourse.group/u/bastonero)\
**Post date:** [October 10, 2024, 10:35am UTC](https://aiida.discourse.group/t/do-glob-patterns-work-for-remote-copy-lists/474/5 "2024-10-10T10:35:15Z")

</div>

Thanks @giovannipizzi ! It did work using `.`

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/aiida/original/1X/c417197d3750949351575d03ed03f5e2ad32e649.png) [@system](https://aiida.discourse.group/u/system)\
**Post date:** [October 16, 2024, 6:35am UTC](https://aiida.discourse.group/t/do-glob-patterns-work-for-remote-copy-lists/474/6 "2024-10-16T06:35:58Z")

</div>

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