
Core Plugins and tasks Size
CertifiedGet the size of a file in Kestra internal storage.
Core Plugins and tasks Size
Certified
Get the size of a file in Kestra internal storage.
Reads the file attributes for the given kestra:// URI and returns its size in bytes.
yaml
type: io.kestra.plugin.core.storage.SizeExamples
Get the size of a text file generated by another task.
yaml
id: get_file_size
namespace: company.team
tasks:
- id: generate_file
type: io.kestra.plugin.scripts.shell.Commands
commands:
- echo "Hello John" > name.txt
outputFiles:
- "name.txt"
- id: get_size
type: io.kestra.plugin.core.storage.Size
uri: "{{ outputs.generate_file.outputFiles['name.txt'] }}"
- id: log
type: io.kestra.plugin.core.log.Log
message: "{{ outputs.get_size.size }} bytes"
Properties
uri *Requiredstring
The file where size needs to be fetched
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
Outputs
size integer
The size of the file in bytes