Search code examples
nextflow

change the location of the .nextflow folder?


when I run nextflow, I get a .nextflow folder, but I can't find a way to change its location (i.e. it isn'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.


Solution

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