Can't execute unix script from SAP BO DI


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Can't execute unix script from SAP BO DI
# 1  
Old 09-16-2010
Can't execute unix script from SAP BO DI

Dear all, I am very new to UNIX but and need some help in order to make BO DI Job Server execute a .sh script.

My unix script has set permissions as under:

Code:
-rwxrwxrwx.

What I m trying to do is move a .txt file from one directory to another on UNIX server. I have full access to Feed directory and Target directory is a subdirectory of Feed directory.

As of now, job has no errors, but nothing happens: file is not moved.

Btw, the unix script is:

Code:
#!/usr/bin/ksh
mv /export/home/chgthfy/hello.txt /export/home/chgthfy/Archive/hello.txt .
asc
bye
EOF

Do I need to log in to the feed directory again even though I have full access to it? I guess the Job Server needs to log in, not me as a user. How can I get this done? I do not know the IP address of the server, but can find out.

Thanks for your help!!!
E

Last edited by Scott; 09-16-2010 at 05:32 PM.. Reason: Please use code tags
# 2  
Old 09-16-2010
Hi.

Is that . (full-stop) at the end of your mv command punctuation that you typed here, or part of the command? That would affect the command.

The asc, bye and EOF looks like they may have started life something like:

Code:
ftp ...... << EOF
....
asc
...
bye
EOF

What is that for?
# 3  
Old 09-16-2010
Hi Scottn,

Thanks for your quick reply.

At the end of the mv command I have space and a period (.) It is supposed to move it with the same name to the Target directory. Is this correct?

Not sure what else I can say, apart from..: at the beginning DI job server didn't have access to the .sh script. Then I learned how to change its permission settings using chmod a+rwx in putty in order to make it an executable. so, right now, I need to figure out correct syntax.

I appreciate your help!
E
# 4  
Old 09-16-2010
Hi.

No. The period will move A and B to . (the current directory)...

Code:
$ mkdir A B                                           # Create two directories, A and B
$ ls -ld A B                                          # List them
drwxr-xr-x  2 scott  staff  68 16 Sep 22:53 A
drwxr-xr-x  2 scott  staff  68 16 Sep 22:53 B
$ touch A/hello.txt                                   # Create a file in directory A
$ mv A/hello.txt B/hello.txt .                        # Move it, and a file in directory B to . (the current directory)
mv: B/hello.txt: No such file or directory            # You would have got an error, but did not see it?
$ ls A                                                # List directory A
(nothing)
$ ls B                                                # List directory B
(nothing)
$ ls hello.txt                                        # List hello.txt in the current directory (i.e. not directory B)
hello.txt

mv will take the last argument (. in this case) to be the target.

You should remove the dot.

Last edited by Scott; 09-16-2010 at 06:03 PM..
# 5  
Old 09-16-2010
Hi Scottn,

I used the following:

Code:
$ mv /export/home/hello.txt  ./Archive

and it worked. Thanks!

Now I need to figure out how to figure out how to incorporate the syntax into a .sh file and make/allow DI job server to login to the directory on the unix server. I am thinking of the following:

Code:
#!/usr/bin/ksh
mv /export/home/hello.txt  ./Archive
ftp -v -n 161.145.174.13 << EOF
user username password
bye
EOF

Any ideas?
Thanks in advance!

Last edited by Scott; 09-16-2010 at 06:23 PM.. Reason: Code tags
# 6  
Old 09-16-2010
Quote:
I need to figure out how to figure
I like the way you think Smilie

OK, so you've moved the file from A to B.

Now what? You want to copy it to another server?

Code:
ftp -v -n 161.145.174.13 << EOF
user username password
asc
put Archive/hello.txt /dir/on/remove/server/hello.txt
bye
EOF

Being honest... as common as it is, I never use FTP in this way. The idea of having passwords in plain text is never a good idea.

I would scp normally. But your FTP command, as shown would probably work.
This User Gave Thanks to Scott For This Post:
# 7  
Old 09-17-2010
Thanks, Scottn! I will take it from here and post the solution once successfully tested Smilie

MfG
E
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execute powershell script with UNIX

Hi I have a powershell script which is checking whether a windows service is running (as shown below) function FuncCheckService { $ServiceName = 'pgsql-9.2' $arrService = Get-Service -Name $ServiceName if ($arrService.Status -eq 'Running') { Write-Output... (8 Replies)
Discussion started by: simpsa27
8 Replies

2. Shell Programming and Scripting

Batch script to execute shell script in UNIX server

Hi team, My requirement is to transfer pdf files from windows machine to unix server and then from that unix server we should sftp to another server. I have completed the first part i.e From windows to using to unix server with the help of psftp.exe code: psftp user@host -pw password <... (1 Reply)
Discussion started by: bhupeshchavan
1 Replies

3. Shell Programming and Scripting

Dos batch script to execute unix shell script

Can anyone help me with a dos batch script to execute a shell script residing in an unix server. I am not able to use ssh. Thanks in advance (2 Replies)
Discussion started by: Shri123
2 Replies

4. UNIX for Dummies Questions & Answers

Spool setting in unix environment for SAP

Hi All, Please help me regarding this. we have our SAP system with unix environment. Spool setting in unix ,we are not able to cancel any unix spool from SIDADM because the spool user is nor SIDADM. for example :- Any idea how to make the spool from OS level as SIDADM, Please suggest.... (3 Replies)
Discussion started by: dravi_laxmi
3 Replies

5. UNIX for Dummies Questions & Answers

commands to execute unix script

commands to execute unix script (1 Reply)
Discussion started by: sunilamarnadh
1 Replies

6. Shell Programming and Scripting

Execute unix shell script to text file using the script

Hi all, I am beginner in UNIX...I want to use unix shell script to create text.file...I know how to use using by command...can anybody tell me for the script? Thanks i changed the threads title from "tex file" to "text file", because "tex" would probably be misunderstood as reference to... (4 Replies)
Discussion started by: mastercar
4 Replies

7. Shell Programming and Scripting

Execute SQL query in unix script

Hi I am new in unix. oracle and unix are installed in my sytem.i need the script which could connect to the oracle using username ,password and schema and can run the select * from tab query. Thanks vijay (8 Replies)
Discussion started by: vijays3
8 Replies

8. UNIX for Dummies Questions & Answers

UNIX commands fr SAP

Hi Has anyone worked in SAP/Netweaver. Im looking for some basic unix commands for SUN servers. Unix commands like check if the java server is running or not..etc please help thanks -m77 (1 Reply)
Discussion started by: m77
1 Replies
Login or Register to Ask a Question