cancel
Showing results for 
Search instead for 
Did you mean: 

Taking backup of o/p file automatically

Former Member
0 Kudos

Hi,

Is there any way to take backup of the o/p file that is created. i hope PI cannot take backup or create the same file in multiple folder.

Can we use any shell script to take the backup automatically once the PI finishes the job of creating the file.

If so, what settings need to be done from PI side to trigger it.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member181985
Active Contributor
0 Kudos

In the receiver file channel use Script in "Run OS command after message processing"

Write the necessary script logic..

Regards

Praveen

Answers (4)

Answers (4)

Former Member
0 Kudos

Actually PI can create multiple copies of the files in multiple folders and it just needs additional configuration in your ID

1) Create a new CC assiciated to the new folder and add it into a new business service.

2) Add this BS as the second entry into your already created Receiver determination.

2) Copy the interface determination changing only the receiver component to your new BS. All other entries remain the same ie., they can be reused.

3) Make sure your existing sender agreement has value * in the receiver section for communication component or no entries at all

4) Copy the receiver agreement to create a new one giving the new receiver comm channel name. The receiver communication component value will reflect the new one created for back up.

Former Member
0 Kudos

Hi Taran & Preethi,

Thanks for the reply.

But i dont want to create another C.C for taking the backup. Rather i want to use the operating system command in the same receiver C.C.

former_member206760
Active Contributor
0 Kudos

hi jjma,

XI can write the same file to multiple folders ...pls see the following steps

.

1. Create another CC with a different folder path ( with the archive folder )

2. create a new Message tupe say MT_tgt2 ( here the data type would be same as MT_tgt1)

3. Create a new Message interface say MI_tgt2 . this will have the message type as in step 2

5. create a new mapping say mm2

6. createa a new interface mapping im2 .

7. Add a receiver in the receiver determination

8. in interface determinatio add the inbound interface as MI_tgt2 and add the interface mapping im2.

Also tick the maintain order at runtime checkbox so that the archive file is created only if the original fiel is created OK

9. finally create a new receiver agreement with the new CC and new inbound interface

Edited by: Tarang Shah on Feb 1, 2010 6:43 PM

former_member187339
Active Contributor
0 Kudos

Hi,

You can use this OS script directly in the Communication channel

1. Make sure you call this after message processing

2. CMD /C "copy /Y %F <give here the path>"

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

Thanks for the reply.

I have done in the same way as you have mentioned. we are using sFTP. Pls find below:

In the receiver C.C ---> Processing tab -


> Run operating system command after message processing -


>

Command line : CMD /C "copy /Y %F /ftplnote/backup"

Timeout : 20

But its not working. A copy of the file is not present in the specified sFTP folder /ftplnote/backup.

Can you let me know what is the error.

former_member187339
Active Contributor
0 Kudos

Hi,

Try giving like this:

>>CMD /C "copy /Y %F \ftplnote\backup"

Also if you can specify the fully qualified path something like

>>CMD /C "copy /Y %F
<ip-address>\ftplnote\backup"

Regards

Suraj

Former Member
0 Kudos

Hi suraj,

Thanks for the reply.

Actually we are using Unix OS.

so i am trying

 CP <source folder> <dest folder> 

but still it is not working.

former_member187339
Active Contributor
0 Kudos

Hi,

Try giving like this:



CP -f %F <dest folder>

Also if possible provide your dest folder. Make sure your dest path say

\tmp\folderx\foldery is already created and it shoudl be a complete path , that is it shoudl start from the root \

Regards

Suraj

Former Member
0 Kudos

Hi,

The problem was solved by using the following command:

cp -pr -f %F <dest folder>

Former Member
0 Kudos

Hi,

> Can we use any shell script to take the backup automatically once the PI finishes the job of creating the file.

By using the OS commands you can achieve this. Use the OS commands after processing command.

FYI

http://help.sap.com/saphelp_nwpi71/helpdata/en/44/556cb799c93677e10000000a114a6b/content.htm

/people/santhosh.kumarv/blog/2008/07/27/glimpse-at-os-command-yet-another-scenario

> If so, what settings need to be done from PI side to trigger it.

No settings are required, once you develope the code (if the OS is windows then batch file, if it is UNIX shell script file) then you have to deploy that file in any one of the PI server system directory. In the OS command after processing step in you have to mention the batch/shell script file with the URL(Location of the file where we placed in the PI system).

Regards

Ramesh

Former Member
0 Kudos

Hi VenkataRamesh,

Thanks for the reply.

I have followed the steps below:

In the Receiver file I have given the path for the command line which is present in my desktop:

Command line : C:\Documents and Settings\JJ\Desktop\copy.bat %F %f

timeout : 20

Code for copy.bat :


@ECHO OFF 

COPY %1 C:\Documents and Settings\JJ\Desktop\file1

but this doesnt show any effect in the execution. it doesnt create a copy of the file.

And i m generating the o/p file name at run time and gave the respective adapter-specific parameters too.