cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy a file before deleting

Former Member
0 Kudos

Hi ,

I have scenario file to idoc. while configuring the sender communication channel(with sender file adaper) the file processing mode should be delete mode but my requirement is i need to copy a file into some other floder before deleting the file from source directory.

Regards

Swathi

Accepted Solutions (0)

Answers (3)

Answers (3)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Swathi,

There is a option in sender file adapter called "Run Operating System Command Before message Processing ".

In that option you need to write as shown below

if operating system of PI server is unix/linux then type


cp   %F  /usr/dev/folder

Change the target folder name from /usr/dev/folder to where ever you wish to copy the file

in case you are working on windows enviornment you can try this


copy %F   C://usr//dev//temp

Please change the target folder name from C://usr//dev//temp to where ever you wish to copy the file.

Hope this solves your problem.

regards

Anupam

Former Member
0 Kudos

Hi,

Processing Mode, specify what is to happen to files that have been processed successfully.

Have you use Archive, ithink its work

○ Archive

■ To add a time stamp to the file name, select Add Time Stamp.

The time stamp has the format yyyMMdd-hhMMss-SSS. The time stamp ensures that the archived files are not overwritten and it enables you to sort them according to the time that they were received.

■ Enter the name of the Archive Directory.

regards,

ganesh.

Former Member
0 Kudos

Hi Ganesh,

Thanks for your response.

I should not use Archive mode, i have to use delete mode and copy the files to other folder before deleting the file.

Regards

Swathi

Former Member
0 Kudos

i guess u r picking the file from a FTP server..so what u can do is that make a FILE(ftp) TO FILE(nfs) scenario (without mapping) and dump the file on the XI server location (NFS) and then in ur actual scenario i.e file to IDOC pick the file from the NFS location, archive the same on some xi directory and do rest of the processing..

Former Member
0 Kudos

Hi Swathi,

You can create 2 receivers channels. One for archiving your source file and one for your orginal receiver channel. On your File receiver channel for archive, you can define the archive directory and the filename of your source file. You can use dynamic config to get the source file.

You can define the 2 business component/business component on the receiver determination and 2 receiver agreement.

Regards,

Jenny

PriyankaAnagani
Active Contributor
0 Kudos

Hi swathi,

You can try with file procesing mode "Archieve" and specify the folder name so that the file will be moved to archieved folder.

Regards

Priyanka