Created on 12-30-2017 12:53 AM - edited 08-17-2019 05:29 PM
Hi all, i need some help with this behaviour. I have 2 processors (GetFTP > PutFTP) and i had a trouble with the manipulation about the lastModifiedTime, i need to set the original date of the sourcefile when i do the PutFTP .
i had let the property unset but the attribute lastModifiedTime has change.
Nifi version 1.4.0-rc2
The documentation saids:
The lastModifiedTime to assign to the file after transferring it. If not set, the lastModifiedTime will not be changed. Format must be yyyy-MM-dd'T'HH:mm:ssZ. You may also use expression language such as ${file.lastModifiedTime}. If the value is invalid, the processor will not be invalid but will fail to change lastModifiedTime of the file.
Supports Expression Language: true
Regards
Created on 12-30-2017 06:09 AM - edited 08-17-2019 05:29 PM
Scenario 1:-
In your PutFTP processor change
Last Modified Time property to
${file.lastModifiedTime}
If we mention the property value as above in putftp processor configurations then the new file(push test directory) will have same lastmodifiedtime as the sourcefile.
Configs:-
Scenario 2:-
If we keep the Last Modified Time property as Blank(same configurations as mentioned in your question)
Then putftp processor will set last modified time of the file as new time(not the source file last modified time).
When we pulls the file from the Destination directory(push test) we are going to see the Different last modified times compared to source file(pull test) last modified time.
I think you are facing scenario 2 to get same last modified time as source file just change the property as suggested above in Scenario 1.
Then compare the Last Modified Times between source file(pull test) with destination file(push test), they are going to be same.
If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of errors.
Created on 12-30-2017 12:48 PM - edited 08-17-2019 05:29 PM
Hi Shu, thanks for your answer.
i had tried your advice setting the ${file.lastModifiedTime} but the processor raise this warning and set the execution date as the lastModifiedTime on the destination file .
Regards
Created 12-30-2017 07:25 PM
Hi @Shu
After read this warning and review in detail the code of the PutFile Processor, i had find line 394:
// FTP server probably doesn't support MFMT command
So i guess that this behaviour its related with the vsftpd server (version 3.0.3). I will test another ftpserver.
Regards
Created 06-17-2020 04:59 AM
How to do this for putHDFS processor? I don't see any Last Modified Time property in that.