
File system Delete
CertifiedDelete a file on NFS
File system Delete
Delete a file on NFS
Removes a file from an NFS mount. By default errorOnMissing is true and raises when the target is absent.
When regExp is set, uri must point to a directory. All regular files whose absolute path matches the
expression are deleted. Set recursive to true to also traverse subdirectories.
type: io.kestra.plugin.fs.nfs.DeleteExamples
Delete a single file from an NFS mount.
id: nfs_delete
namespace: company.team
tasks:
- id: delete_file
type: io.kestra.plugin.fs.nfs.Delete
uri: /mnt/nfs/shared/logs/old_log.txt
errorOnMissing: false
Delete files matching a pattern in a directory.
id: nfs_delete_logs
namespace: company.team
tasks:
- id: delete_logs
type: io.kestra.plugin.fs.nfs.Delete
uri: /mnt/nfs/shared/logs
regExp: '.*\.log'
recursive: true
errorOnMissing: false
Properties
uri *Requiredstring
Path of the file or directory to target
errorOnMissing booleanstring
trueRaise an error if the target is missing
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
recursive booleanstring
falseInclude subdirectories
If true, traverses subdirectories when deleting files matching regExp.
regExp string
A regular expression to filter files for deletion
When set, uri must point to a directory. The pattern is matched against the absolute OS path of each file (for example, /mnt/nfs/shared/logs/old.log). Only regular files are deleted; directories are skipped.
Outputs
deleted boolean
falseWhether at least one file was deleted
uri string
uriThe URI of the deleted file, or the target directory when regExp is used
uris array
URIs of all deleted files when regExp is used. Empty for single-file deletions