- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How can we delete files after sftp using Nifi processors
- Labels:
-
Apache NiFi
Created ‎05-25-2019 06:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is my scenario that I am implementing in Nifi - I am connecting to external system and need to fetch the files from source directory, I am able to get the files using listftp processor and fetchftp processor and now I am moving files to target location using Putsftp processor/sending it to a rest service using invokehttp processor. After success of this step I need to delete files in source location, but I am not able to delete. I tried using ExecuteStreamcommand Processor to delete the files, but its not working. Did someone encountered this scenario and pls suggest on how to solve this issue.
I tried this approach, but I am not able to delete it
Thanks,
Created ‎10-29-2020 03:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi! Did you solve it?
Created ‎11-01-2020 03:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The executestreamcommand solution should work, as confirmed on this external website:
To quote the most relevant part:
ExecuteStreamCommand solved my problem. Create a small script and execute it with parameters from NiFi: #!/bin/bash HOST=$1 USER=$2 PASSWORD=$3 ftp -inv $HOST <<EOF user $USER $PASSWORD cd /sources delete $4 bye EOF
- Dennis Jaheruddin
If this answer helped, please mark it as 'solved' and/or if it is valuable for future readers please apply 'kudos'.
