# Particular task deleting lib and bin directories in install directory

**URL:** <https://cylc.discourse.group/t/particular-task-deleting-lib-and-bin-directories-in-install-directory/788>\
**Category:** Cylc Support\
**Created:** [October 24, 2023, 2:36am UTC](https://cylc.discourse.group/t/particular-task-deleting-lib-and-bin-directories-in-install-directory/788 "2023-10-24T02:36:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonnyhtw](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jonnyhtw/32/232_2.png) [@jonnyhtw](https://cylc.discourse.group/u/jonnyhtw)\
**Post date:** [October 24, 2023, 2:36am UTC](https://cylc.discourse.group/t/particular-task-deleting-lib-and-bin-directories-in-install-directory/788/1 "2023-10-24T02:36:32Z")

</div>

hey there,

i have a workflow which installs lots of files in `~/cylc-run/$CYLC_WORKFLOW_ID/bin` and `~/cylc-run/$CYLC_WORKFLOW_ID/bin`.

however when i run `cylc vr` the `lib` and `bin` directories get deleted…

```auto
> cylc vr $(basename $PWD)/run1
$ cylc validate --against-source u-cy032/run1

Valid for cylc-8.2.1

$ cylc reinstall u-cy032/run1

REINSTALL u-cy032/run1 from /scale_wlg_persistent/filesets/home/williamsjh/roses/u-cy032

del. lib/python/irislib/utils/etc/fields.rc
[snip]
del. bin/zonal_mean.py
[snip]

NOTE: Files created by Rose file installation will show as deleted.
      They will be re-created during the reinstall process.

```

the key point here is that they are _not_ re-created in the reinstall.

any ideas on how i can fix this? currently i have to manually rerun a task to get them back.

thanks!

jonny

---

<div class="post-metadata">

**Author:** ![hilary.j.oliver](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/hilary.j.oliver/32/4_2.png) [@hilary.j.oliver](https://cylc.discourse.group/u/hilary.j.oliver)\
**Post date:** [October 24, 2023, 4:11am UTC](https://cylc.discourse.group/t/particular-task-deleting-lib-and-bin-directories-in-install-directory/788/2 "2023-10-24T04:11:11Z")

</div>

Workflow reinstallation updates the run directory to be compatible with the source directory. That includes deleting files that are no longer present in the source directory (or in your case, never existed there!). That’s deliberate, because files that should not be there could in principle cause trouble at run time.

If your workflow generates files at run time that should not be deleted during reinstall, they should go under the `share` directory, which is reserved for files generated at run time. So executables and library files installed by an “install task” at run time should go in `share/bin/` and `/share/lib/`. Top level `bin/` and `lib/` are for executables and library files installed from the source directory, and subject to update or removal by the reinstall process.

Documentation:

- [Workflow Share Directories](https://cylc.github.io/cylc-doc/stable/html/user-guide/writing-workflows/runtime.html#workflow-share-directories)
- And see the “Note” box at the bottom of [Workflow Configuration — Cylc 8.2.2 documentation](https://cylc.github.io/cylc-doc/stable/html/user-guide/writing-workflows/configuration.html#workflow-configuration-directories)

---

<div class="post-metadata">

**Author:** ![jonnyhtw](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jonnyhtw/32/232_2.png) [@jonnyhtw](https://cylc.discourse.group/u/jonnyhtw)\
**Post date:** [October 24, 2023, 10:57pm UTC](https://cylc.discourse.group/t/particular-task-deleting-lib-and-bin-directories-in-install-directory/788/3 "2023-10-24T22:57:45Z")

</div>

ok roger that, thanks.

is this a new cylc 8 thing? i don’t remember this ever being an issue before. the reason i ask is that climate workflows very frequently check out files from the MOSRS repository at install time.

cheers,

---

<div class="post-metadata">

**Author:** ![hilary.j.oliver](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/hilary.j.oliver/32/4_2.png) [@hilary.j.oliver](https://cylc.discourse.group/u/hilary.j.oliver)\
**Post date:** [October 24, 2023, 11:37pm UTC](https://cylc.discourse.group/t/particular-task-deleting-lib-and-bin-directories-in-install-directory/788/4 "2023-10-24T23:37:24Z")

</div>

Well it’s definitely new in the sense that Cylc 7 did not have built-in workflow installation capability at all.

Somewhat less definitely, I think `rose suiite-run` (for Cylc 7) did not do it either.

---

<div class="post-metadata">

**Author:** ![jonnyhtw](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jonnyhtw/32/232_2.png) [@jonnyhtw](https://cylc.discourse.group/u/jonnyhtw)\
**Post date:** [October 25, 2023, 5:29am UTC](https://cylc.discourse.group/t/particular-task-deleting-lib-and-bin-directories-in-install-directory/788/5 "2023-10-25T05:29:19Z")

</div>

ok thanks for this. i think this is going to involve some refactoring of some of the workflows that we use but it sounds like a pretty straightforward fix (i.e. installing stuff in `share` rather than `bin`).

cheers!

---

<div class="post-metadata">

**Author:** ![hilary.j.oliver](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/hilary.j.oliver/32/4_2.png) [@hilary.j.oliver](https://cylc.discourse.group/u/hilary.j.oliver)\
**Post date:** [October 25, 2023, 7:40am UTC](https://cylc.discourse.group/t/particular-task-deleting-lib-and-bin-directories-in-install-directory/788/6 "2023-10-25T07:40:55Z")

</div>

Use `share/bin/` - that’s in `$PATH` in your job environment just like `bin/`

---

<div class="post-metadata">

**Author:** ![jonnyhtw](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/jonnyhtw/32/232_2.png) [@jonnyhtw](https://cylc.discourse.group/u/jonnyhtw)\
**Post date:** [October 25, 2023, 9:05am UTC](https://cylc.discourse.group/t/particular-task-deleting-lib-and-bin-directories-in-install-directory/788/7 "2023-10-25T09:05:51Z")

</div>

hey @hilary.j.oliver, will do 🙂 thanks 🙏
