Support Questions

Find answers, ask questions, and share your expertise

Copy Folders with Nifi

avatar
Contributor

Is there a way to copy and retain recursive folder structure using Nifi? I am able to copy individual files, but it would be great to be able to copy subfolders.

1 ACCEPTED SOLUTION

avatar

@David Williamson

If you are using GetFile and PutFile processors to copy individual files, they can also be used for recursive folder structure.

One of the attributes written by GetFile is the folder path of the file, so you can use PutFile to create the folder structure in the new location.

View solution in original post

3 REPLIES 3

avatar

@David Williamson

If you are using GetFile and PutFile processors to copy individual files, they can also be used for recursive folder structure.

One of the attributes written by GetFile is the folder path of the file, so you can use PutFile to create the folder structure in the new location.

avatar

@David Williamson

Yes, the ListFile writes the same attributes. But, make sure the user running NiFi has the permissions to create directories in HDFS.

avatar
Contributor

Sorry, I should have clarified this some more. I am currently using ListFile, FetchFile, and PutHDFS. Do the same settings apply?