# Cylc8 custom share directory location issue

**URL:** <https://cylc.discourse.group/t/cylc8-custom-share-directory-location-issue/535>\
**Category:** Cylc Support\
**Created:** [September 14, 2022, 6:29am UTC](https://cylc.discourse.group/t/cylc8-custom-share-directory-location-issue/535 "2022-09-14T06:29:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveLee](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@DaveLee](https://cylc.discourse.group/u/DaveLee)\
**Post date:** [September 14, 2022, 6:29am UTC](https://cylc.discourse.group/t/cylc8-custom-share-directory-location-issue/535/1 "2022-09-14T06:29:29Z")

</div>

Hi,

I’m running a rose stem via Cylc8 as:

```auto
rose stem -n lfric_cylc8 rose-stem --opt-conf-key=$platform --group=developer --source=lfric=$lfric
cylc play lfric_cylc8

```

with a `~/.cylc/flow/global.cylc` file as:

```auto
[install]
    [[symlink dirs]]
        [[[gadi]]]
            log = /scratch/dp9/dl9118
            share = /scratch/dp9/dl9118
            work = /scratch/dp9/dl9118

```

(where `gadi` is the remote host). On the remote host the `log` and `work` directories are softlinked to `~/cylc-run/lfric_cylc8/run1` from `/scratch/dp9/dl9118/cylc-run/lfric_cylc8/run1` as expected, however the `share` directory is not being soft linked properly:

```auto
lrwxrwxrwx 1 dl9118 dp9 49 Sep 14 13:19 log -> /scratch/dp9/dl9118/cylc-run/lfric_cylc8/run1/log
drwxr-sr-x 3 dl9118 dp9 4.0K Sep 14 15:10 .service
drwxr-xr-x 6 dl9118 dp9 4.0K Sep 14 13:20 share
lrwxrwxrwx 1 dl9118 dp9 50 Sep 14 13:19 work -> /scratch/dp9/dl9118/cylc-run/lfric_cylc8/run1/work

```

Running `cylc config` I see:

```auto
[dl9118@ood-vn5 gungho]$ cylc config
[scheduler]
    [[host self-identification]]
        method = hardwired
        host = ood-vn5
[install]
    source dirs = ~/cylc-src, ~/roses
    [[symlink dirs]]
        [[[ood]]]
        [[[gadi]]]
            log = /scratch/dp9/dl9118
            share = /scratch/dp9/dl9118
            work = /scratch/dp9/dl9118
...

```

so I don’t know why this isn’t being picked up and a soft link being created for `share` on the remote host.

Any help would be gratefully appreciated.

Cheers, Dave.

---

<div class="post-metadata">

**Author:** ![ScottWales](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/scottwales/32/192_2.png) [@ScottWales](https://cylc.discourse.group/u/ScottWales)\
**Post date:** [September 14, 2022, 6:49am UTC](https://cylc.discourse.group/t/cylc8-custom-share-directory-location-issue/535/2 "2022-09-14T06:49:50Z")

</div>

Seems to be coming from the task script rather than Cylc, it’s running

```auto
++ rose host-select gadi.nci.org.au
+ HOST=gadi.nci.org.au
++ echo /home/562/saw562/cylc-run/lfric_cylc8/run1/share/source
++ sed 's|/home/562/saw562/||'
+ RELATIVE_SOURCE_DIRECTORY=cylc-run/lfric_cylc8/run1/share/source
+ ssh gadi.nci.org.au mkdir -p cylc-run/lfric_cylc8/run1/share/source
+ rsync -avz /home/562/saw562/cylc-run/lfric_cylc8/run1/share/source/ gadi.nci.org.au:cylc-run/lfric_cylc8/run1/share/source/

```

---

<div class="post-metadata">

**Author:** ![DaveLee](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@DaveLee](https://cylc.discourse.group/u/DaveLee)\
**Post date:** [September 14, 2022, 7:02am UTC](https://cylc.discourse.group/t/cylc8-custom-share-directory-location-issue/535/3 "2022-09-14T07:02:04Z")

</div>

Thanks Scott! I’ll see if I can find a way to install the entire suite under `/scratch` instead of `~/`.

---

<div class="post-metadata">

**Author:** ![oliver.sanders](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/oliver.sanders/32/110_2.png) [@oliver.sanders](https://cylc.discourse.group/u/oliver.sanders)\
**Post date:** [September 14, 2022, 8:39am UTC](https://cylc.discourse.group/t/cylc8-custom-share-directory-location-issue/535/4 "2022-09-14T08:39:30Z")

</div>

To link the entire workflow run directory use `run`.

[https://cylc.github.io/cylc-doc/stable/html/reference/config/global.html#global.cylc[install][symlink%20dirs][\<install%20target\>]run](https://cylc.github.io/cylc-doc/stable/html/reference/config/global.html#global.cylc%5Binstall%5D%5Bsymlink%20dirs%5D%5B%3Cinstall%20target%3E%5Drun)

Note this will move all files including those that Cylc manages such as the workflow database.

---

<div class="post-metadata">

**Author:** ![DaveLee](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@DaveLee](https://cylc.discourse.group/u/DaveLee)\
**Post date:** [September 15, 2022, 5:21am UTC](https://cylc.discourse.group/t/cylc8-custom-share-directory-location-issue/535/5 "2022-09-15T05:21:58Z")

</div>

Thank you for making me aware of this Oliver. I tried setting the whole run dir to `/scratch`, but as Scott says, the initial task on the localhost goes off and makes the `share` dir first, so this may require some modification of the suite itself.

---

<div class="post-metadata">

**Author:** ![oliver.sanders](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/oliver.sanders/32/110_2.png) [@oliver.sanders](https://cylc.discourse.group/u/oliver.sanders)\
**Post date:** [September 15, 2022, 9:18am UTC](https://cylc.discourse.group/t/cylc8-custom-share-directory-location-issue/535/6 "2022-09-15T09:18:37Z")

</div>

Ah right, yes creating the share dir manually will break the `symlink dirs` feature.

A quick workaround is to run a blank task on the remote platform _before_ this local task runs.

```auto
install_remote => install_local

[runtime]
    [[install_remote]]
        # a blank task which triggers Cylc's remote installation
        # (run this before local tasks which attempt to install into the remote cylc-run directory)
        platform = my_platform
    [[install_local]]
         # a local task which installs things into the remote cylc-run directory
         script = rsync /something my_platform:cylc-run/${CYLC_WORKFLOW_ID}/share/something
        platform = localhost

```

---

<div class="post-metadata">

**Author:** ![DaveLee](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@DaveLee](https://cylc.discourse.group/u/DaveLee)\
**Post date:** [September 15, 2022, 11:29pm UTC](https://cylc.discourse.group/t/cylc8-custom-share-directory-location-issue/535/7 "2022-09-15T23:29:01Z")

</div>

Thank you Oliver, this looks like a nice work-around. Long term we will no-doubt have to do some restructuring of the LFRic rose stems, so we can address this more holistically at that point. Thanks again, Dave.
