cancel
Showing results for 
Search instead for 
Did you mean: 

FTP File archive

Former Member
0 Kudos

Hi all,

I am using an FTP server and I want the files to be archived in the same source directory with the timestamp. But my scenario works fine by picking the source file but not archiving ie it is not adding timestamp to the source file instead the source file remains in the directory and also output file is generated successfully.

Regards,

Nithiyanandam

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The archived file also use the same naming convention that you have used for Output file.

So if you need to handle the archived file name along with timestamp then you could do this with useing customized adapter modules for FTP adapter.

Either way if you wish to achive it you could write the batch file on FTP server with the logic to rename the output file in same target directory to archive along with required naming format i.e Timestamp.

Thanks

Swarup

Former Member
0 Kudos

Hi,

Let me make it clear, I have a source file once it is processed successfully, the source file has to be archived in the same location as the source directory.

But the source file has to be added with the timestamp when archived.

Also I am creating the target file in a different directory.

But the source and the target directories are in FTP servers.

I am able to process the file successfully with delete mode, but when I use archive mode the file is not getting renamed as i add the timestamp to it, by checking the timestamp option. But the target file is getting generated successfully.

Regards,

Nithiyanandam

Former Member
0 Kudos

HI Nithiyanandam,

The archive mode will not work with the file name having Timestamp, because once the file is processed, it will be in target directory. After completion of processing the file, the file get moved to archive folder.

But if norammly the time stamp (milisec) values get changed and FTP adapter faile to archive it as it will not get the file with latest Timestamp.

Probably you could do one thing,

Create one Bathc file on FTP server and keep it in same directory.

Now in batch file you can rename it as you want and move it to archive folder by using FTP commands.

Once the file get renamed and copied to archive folder you can delete it (add delete file as last statement in batch file).

In FTP adapter you could state the OS commands after file processing. here you just call that batch file.

It will work as per your requirment

Thanks

Swarup

Former Member
0 Kudos

Hi,

Thanks for your reply.

Could you please let me know how to write a batch file that is in the runtime command. I went to certain blog but I couldn't understand that.

So if will be great if you could provide me the details of the batch files along with the runtime command.

Regards,

Nithiyanandam

Former Member
0 Kudos

Hi Nithyanandam & Swarup

It is not that "The archive mode will not work with the file name having Timestamp

You cannot archive your file in the same directory from where you pick up the files. try giving a different directory. probably a folder in the same path with name "archive"...

the files will get archived , also with timestamps.

Hope this fixes your issue.

Regards

Vishnu

Former Member
0 Kudos

Hi Guys,

I have query with regard to FTP transport protocol archive mode.

When I tested locally with NFS, the files are getting archived, but when the same is tested with FTP, I am not able to move the files within folders in FTP i.e. I have 3 folders in FTP server an input, archive and output folder, File is processed processed and I am not able to get the files moved to archive directory.

But instead file is in input folder itself, even when I tried manually to copy and paste the file with in the folders in ftp i m not able to do that.

When I checked with few collegues here it seems like the IIS FTP server does not support that facility to move files within folders in FTP.

Can anyone please confirm that and provide any other alternatives for it.

Regards,

Nithiyanandam

Former Member
0 Kudos

Hi Nithiyanandam

Also note this SAP note- 841704.

The OS commands cannot work on system other than the one on which the Adapter resides.Hence it is not possible to run the scripts on the FTP server.

One thing that is possible is that FTP server itself should have somekind of work around to move the processed file to an Archive folder.

Regards

Priyanka

Former Member
0 Kudos

Hey,

Thanks for that..

Can u provide me your details to

Regards,

Nithiyanandam

**********

Please read the Forum's Rules of Engagement,

i.e.,

[/thread/117188 [original link is broken];

and refrain from using email correspondence as the main objective of the Forums is to share knowledge.

SDN PI/XI Forum Moderator

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Just a hint, check sap note 812409.

reagards.

roberti