Does anyone know if Rundeck has the functionality to trigger a job upon the arrival of a file in a directory?
I've searched a bit, and it doesn't seem like I've found this feature, either in the enterprise version or in the community version.
Does anyone know if Rundeck has the functionality to trigger a job upon the arrival of a file in a directory?
I've searched a bit, and it doesn't seem like I've found this feature, either in the enterprise version or in the community version.
That is an appropriate circumstance for the Waitfor Rundeck Nixy Plugin.
You may install it by going to the gear icon > plugins > locate plugins > in the "search for..." area, type "nixy" and then install the "*nixy waitfor Steps" plugin.
Now, in your workflow, you add a step to validate that, called "*nixy / waitfor / file-exist". You can provide the file path, the wait interval in seconds, and the maximum number of tries.
Check this job definition example:
This job waits 60 seconds for the "myfile" file on the
/home/user/Downloads/directory, if the file isn't there, it tries twice.Alternatively, you can put a bash script logic in a script step job like this script:
Now, the script working in a Rundeck job (the directory path is defined in an Rundeck Option).