You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Jairo Henao <ja...@gmail.com> on 2020/08/11 22:16:12 UTC

FetchSFTP: Rename file on move

Hi community,

Is there a way to rename a file before moving it with FetchSFTP?

After processing a file, I need to move it to a folder and add a timestamp
suffix to it. The file in the source always has the same name,  but I need
that when moving it they are not overwritten.

Any ideas or is it necessary to request a modification to the processor?

Thanks

-- 
Jairo Henao
@jairohenaorojas

Re: FetchSFTP: Rename file on move

Posted by Jairo Henao <ja...@gmail.com>.
Thanks for the suggestions.

The combination of UpdateAttribute (Setting the new filename) with PutSFTP
works fine!




On Tue, Aug 11, 2020 at 5:59 PM Andy LoPresto <al...@apache.org> wrote:

> You can also use an UpdateAttribute processor to change the “filename”
> attribute, which is what any “file persistence” processor (PutSFTP,
> PutFile, etc.) will use when writing the file out.
>
>
> Andy LoPresto
> alopresto@apache.org
> *alopresto.apache@gmail.com <al...@gmail.com>*
> He/Him
> PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69
>
> On Aug 11, 2020, at 3:47 PM, Joe Witt <jo...@gmail.com> wrote:
>
> Jairo
>
> You can use a PutSFTP after Fetch to place it where you want.
>
> Thanks
>
> On Tue, Aug 11, 2020 at 3:16 PM Jairo Henao <ja...@gmail.com>
> wrote:
>
>> Hi community,
>>
>> Is there a way to rename a file before moving it with FetchSFTP?
>>
>> After processing a file, I need to move it to a folder and add a
>> timestamp suffix to it. The file in the source always has the same name,  but
>> I need that when moving it they are not overwritten.
>>
>> Any ideas or is it necessary to request a modification to the processor?
>>
>> Thanks
>>
>> --
>> Jairo Henao
>> @jairohenaorojas
>>
>>
>

-- 
Jairo Henao
@jairohenaorojas

Re: FetchSFTP: Rename file on move

Posted by Andy LoPresto <al...@apache.org>.
You can also use an UpdateAttribute processor to change the “filename” attribute, which is what any “file persistence” processor (PutSFTP, PutFile, etc.) will use when writing the file out. 


Andy LoPresto
alopresto@apache.org
alopresto.apache@gmail.com
He/Him
PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69

> On Aug 11, 2020, at 3:47 PM, Joe Witt <jo...@gmail.com> wrote:
> 
> Jairo
> 
> You can use a PutSFTP after Fetch to place it where you want.
> 
> Thanks
> 
> On Tue, Aug 11, 2020 at 3:16 PM Jairo Henao <jairohenaorojas@gmail.com <ma...@gmail.com>> wrote:
> Hi community,
> 
> Is there a way to rename a file before moving it with FetchSFTP?
> 
> After processing a file, I need to move it to a folder and add a timestamp suffix to it. The file in the source always has the same name,  but I need that when moving it they are not overwritten. 
> 
> Any ideas or is it necessary to request a modification to the processor?
> 
> Thanks
> 
> -- 
> Jairo Henao
> @jairohenaorojas
> 


Re: FetchSFTP: Rename file on move

Posted by Joe Witt <jo...@gmail.com>.
Jairo

You can use a PutSFTP after Fetch to place it where you want.

Thanks

On Tue, Aug 11, 2020 at 3:16 PM Jairo Henao <ja...@gmail.com>
wrote:

> Hi community,
>
> Is there a way to rename a file before moving it with FetchSFTP?
>
> After processing a file, I need to move it to a folder and add a timestamp
> suffix to it. The file in the source always has the same name,  but I
> need that when moving it they are not overwritten.
>
> Any ideas or is it necessary to request a modification to the processor?
>
> Thanks
>
> --
> Jairo Henao
> @jairohenaorojas
>
>