Support Questions

Find answers, ask questions, and share your expertise

Will Nifi delete a file from SFTP ?

avatar
New Contributor

We are using ListSFTP and FetchSFTP to get the files from a vendor SFTP location. There are no explicit delete commands from our end to delete the file . However the file gets deleted and the vendor is pushing it on us saying we are having some process to delete the files . Will FetchSFTP delete the files after its downloaded from the Vendor SFTP server ?


Nifi Process.JPG
1 ACCEPTED SOLUTION

avatar
Master Mentor

@RajiBM 
The NiFi FetchSFTP processor has several "Completion Strategy" options:

  • None (default) <- leaves file as-is on SFTP server after reading content
  • Move File <- Moves file after successful read to directory specified in the "Move Destination Directory" property.
  • Delete File <- Deletes original file from SFTP server after success read of content.

So as long as your FetchSFTP is configured with the default "None" Completion Strategy, the File will remain in original source location on the target SFTP server.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt

View solution in original post

3 REPLIES 3

avatar
Super Guru

What is the "Completion Strategy" property under FetchSFTP is set to? If its set to the default "None" then the file should not be deleted or moved. See the Completion Strategy options under:

https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.20.0/org.apach...

If that helps please accept solution.

 

avatar
New Contributor

Thank you Matt, I see its set to None.

avatar
Master Mentor

@RajiBM 
The NiFi FetchSFTP processor has several "Completion Strategy" options:

  • None (default) <- leaves file as-is on SFTP server after reading content
  • Move File <- Moves file after successful read to directory specified in the "Move Destination Directory" property.
  • Delete File <- Deletes original file from SFTP server after success read of content.

So as long as your FetchSFTP is configured with the default "None" Completion Strategy, the File will remain in original source location on the target SFTP server.

If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.

Thank you,

Matt