File system Delete

File system Delete

Certified

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.

yaml
type: io.kestra.plugin.fs.nfs.Delete

Delete a single file from an NFS mount.

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

yaml
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

Path of the file or directory to target

Defaulttrue

Raise an error if the target is missing

Reference (ref) of the pluginDefaults to apply to this task.

Defaultfalse

Include subdirectories

If true, traverses subdirectories when deleting files matching regExp.

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.

Defaultfalse

Whether at least one file was deleted

Formaturi

The URI of the deleted file, or the target directory when regExp is used

SubTypestring

URIs of all deleted files when regExp is used. Empty for single-file deletions