Skip to main content
RajiBM
Silver ⭐️
May 8, 2023
Solved

Will Nifi delete a file from SFTP ?

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
MattWho
MattWhoAnswer
Titanium ⭐️⭐️⭐️
May 8, 2023

@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

3 replies

SAMSAL
Platinum ⭐️⭐️⭐️
May 8, 2023

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.apache.nifi.processors.standard.FetchSFTP/index.html

If that helps please accept solution.

 

Translate
RajiBM
RajiBMAuthor
Silver ⭐️
May 8, 2023

Thank you Matt, I see its set to None.

Translate
MattWho
Titanium ⭐️⭐️⭐️
MattWhoAnswer
Titanium ⭐️⭐️⭐️
May 8, 2023

@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

Translate