To delete an installed workflow run directory, we recommend using
cylc clean command.
cylc clean takes care of deleting workflows
on the local filesystem and any remote install targets.
It follows any symlink directories specified in
(see A note on symlink directories below). You can also use
cylc clean to
just delete certain files or subdirectories (see Cleaning specific subdirectories or files below).
If you’ve used
rose suite-clean before, the functionality is similar, but
cylc clean only affects workflow run directories
(located in the cylc-run directory). It will not affect
workflow source directories.
cylc clean is intended for use on workflows installed with
cylc install. If you clean a workflow that was instead written
directly in the cylc-run directory and not backed up elsewhere,
it will be lost.
Simple example of using
$ cylc clean myflow/run1 INFO - Removing directory: ~/cylc-run/myflow/run1
Cleaning on remote install targets
If any jobs in your workflow ran on a remote platform, Cylc will automatically remove the workflow files on there in addition to the local filesystem.
$ cylc clean remote-example INFO - Cleaning on install target: enterprise1701 INFO - [enterprise1701] INFO - Removing directory: /home/user/cylc-run/remote-example/run1 INFO - Removing directory: ~/cylc-run/remote-example/run1
This relies on determining which platforms were used from the workflow database. If the platforms recorded in the database are out of date with the global configuration, or if the database is missing altogether, you will have to manually remove the files on remote install targets.
You can also clean on just the local filesystem using the
or just the remote install target using the
Cleaning specific subdirectories or files
You can clean specific subdirectories or files inside a run directory using
--rm option (we refer to this as a targeted clean).
For example, to remove the
$ cylc clean myflow --rm log --rm work
Colons can be used to delimit the items to clean, so the following is equivalent:
$ cylc clean myflow --rm log:work
You can also use globs. E.g., to remove all job logs for cycle points
$ cylc clean myflow --rm 'log/job/2020*'
Make sure to place glob patterns in quotes.
A note on symlink directories
Does this affect me?
If you use symlink directories specified in
global.cylc[install][symlink dirs], you might want to read
this explanation of how Cylc handles them during cleaning.
If you manually delete a run directory (e.g., using the
rm command or the
file manager), only the symlinks themselves will be deleted, not the actual
targets. In contrast,
cylc clean follows the symlinks and deletes the
It only does this for the symlinks that can be set in
global.cylc[install][symlink dirs], not any custom user-created symlinks.
It does not actually look up the global configuration at time of cleaning; it simply detects what symlinks are present out of the possible ones.
It also does this for targeted clean (using the