3

when I run nextflow, I get a .nextflow folder, but I can't find a way to change its location (i.e. it is't -work-dir). How can I change the location of the .nextflow folder?

I have looked at launchDir but it seems that is a read-only implicit variable and cannot be overwritten in the CLI, also, the --launchDir option is only valid for the k8s scope (see original chat in gitter)

I'm using Nextflow 20.10.0 build 5430.

Pablo
  • 983
  • 10
  • 24
  • The `.nextflow` cache directory stores things like the Nextflow CacheDB and plugins (symlinks to the parent repository) for each Nextflow instance. I don't think there's a way to change the parent path of this directory, without changing directories beforehand. I wonder if this is an XY problem? – Steve Nov 23 '21 at 22:44
  • 1
    (i had to look up what an 'XY problem' is)... I have an app that embeds nextflow and during unit and integration tests, I get `.nextflow` folders scattered in the project and tests folder; I want to control the location of the `.nextflow` folders to keep things tidy – Pablo Nov 24 '21 at 10:02

1 Answers1

2

Keeping things neat and tidy is admirable. From this comment, it looks like the only way (without doing crazy things...) is to change to the directory you want your .nextflow cache directory to live and point all other options (i.e. -work-dir, -log etc) away to a separate directory:

If you want .nextflow in dir A and the pipeline work dir in B:

cd A
nextflow run -w B

The .nextflow has to be in the launching directory to properly maintain the history of the executions.

Steve
  • 51,466
  • 13
  • 89
  • 103