Skip to content

Commit ef67b81

Browse files
pditommasobentshermanchristopher-hakkaart
committed
Disable cleanup on remote work dir (#5742)
Signed-off-by: Paolo Di Tommaso <[email protected]> Signed-off-by: Ben Sherman <[email protected]> Co-authored-by: Ben Sherman <[email protected]> Co-authored-by: Chris Hakkaart <[email protected]>
1 parent 76790d2 commit ef67b81

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

docs/reference/config.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ This page lists all of the available settings in the {ref}`Nextflow configuratio
1212
: If `true`, on a successful completion of a run all files in *work* directory are automatically deleted.
1313

1414
:::{warning}
15-
The use of the `cleanup` option will prevent the use of the *resume* feature on subsequent executions of that pipeline run. Also, be aware that deleting all scratch files can take a lot of time, especially when using a shared file system or remote cloud storage.
15+
The use of the `cleanup` option will prevent the use of the *resume* feature on subsequent executions of that pipeline run.
16+
:::
17+
:::{warning}
18+
The `cleanup` option is not supported for remote work directories, such as Amazon S3, Google Cloud Storage, and Azure Blob Storage.
1619
:::
1720

1821
`dumpHashes`

modules/nextflow/src/main/groovy/nextflow/Session.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,11 @@ class Session implements ISession {
12091209
if( aborted || cancelled || error )
12101210
return
12111211

1212+
if( workDir.scheme != 'file' ) {
1213+
log.warn "The `cleanup` option is not supported for remote work directory: ${workDir.toUriString()}"
1214+
return
1215+
}
1216+
12121217
log.trace "Cleaning-up workdir"
12131218
try (CacheDB db = CacheFactory.create(uniqueId, runName).openForRead()) {
12141219
db.eachRecord { HashCode hash, TraceRecord record ->

0 commit comments

Comments
 (0)