How to Execute shell commands in OSB

Team,
My Requirement:
I have two sftp servers name ServerA and ServerB. Need to copy files from ServerA and place it on ServerB and change the file permissions to 777 after placing the files.
The user i am connecting to ServerB has the access to override file permissions.
Steps
1. With help of FTP adapter in OSB I am reading files from ServerA and writing on to ServerB  -- Completed and is working.
2. How to override file permissions after placing the file ????? -- Yet to implement.
Please suggest me how can i accomodate 2nd step.
Thanks,
Suman V.

If by "execute shell commands" you mean actually
running a shell process (as opposed to just forking
and executing specified programs) then I'd advise
against it. The last thing you want is for the
clients to be running arbitrary commands on the
server. You don't want to make it possible for the
client to run "rm -fr /" on your server.Right.
I was assuming (perhaps with more optimism than is really warranted) that the OP was going to be in complete control of which commands were executed--that there'd be a small, fixed set in response to certain user actions.

Similar Messages

  • Execute shell command from Java

    Hi all,
    I need some idea for executing shell script from Java programe.
    For example i have start.sh script in /tmp/start.sh  folder of unix server.
    I want to execute shell script from local java code.
    Any idea on this.

    Hi,
           Read the following articles/posts, maybe this could help you:
          How to execute shell command from Java
    Running system commands in Java applications | java exec example | alvinalexander.com
    Want to invoke a linux shell command from Java - Stack Overflow

  • Executing shell commands from Java.

    I want to execute shell commands in Java using the Runtime.exec( String ) method.
    The method works fine under Linux OS, but under Windows '98 the method didn't work at all!
    For example the following call: Runtime.exec( "dir" ) throws an exception showing that the command was not completed. If I replace dir with ls under Linux all is good. What is the problem with the Microsoft Windows '98 ? Is there any solution at my problem ?!
    thx in advance!

    hey JSarmis,
    You can help me... "ls" doesn't work for me on linux.. using Runtime.exec, some commands work, others don't... you may hold the key to what i need? How did u get "ls" to work?

  • How to execute Linux command from Java app.

    Hi all,
    Could anyone show me how to execute Linux command from Java app. For example, I have the need to execute the "ls" command from my Java app (which is running on the Linux machine), how should I write the codes?
    Thanks a lot,

    You can use "built-in" shell commands, you just need to invoke the shell and tell it to run the command. See the -c switch in the man page for your shell. But, "ls" isn't built-in anyays.
    If you use exec, you will want to set the directory with the dir argument to exec, or add it to the command or cmdarray. See the API for the variants of java.lang.Runtime.exec(). (If you're invoking it repeatedly, you can most likely modify a cmdarray more efficiently than having exec() decompose your command).
    You will also definitely want to save the returned Process and read the output from it (possibly stderr too and get an exit status). See API for java.lang.Process. Here's an example
    java.io.BufferedReader br =
    new java.io.BufferedReader(new java.io.InputStreamReader(
    Runtime.getRuntime().exec ("/sbin/ifconfig ppp0").
    getInputStream()));
    while ((s = br.readLine()) != null) {...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to execute external command?

    How to execute follow command and get its ouput on linux ?
    $ grep processor /proc/cpuinfo | wc -l

    sabre150 wrote:
    nitelia wrote:
    String[] command = {"sh","-c","grep processor /proc/cpuinfo | wc -l"};
              Process pro = Runtime.getRuntime().exec(command);
              BufferedReader bf = new BufferedReader(new InputStreamReader(pro
                        .getInputStream()));
              String x = null;
              while ((x = bf.readLine()) != null) {
                   System.out.println(x);
         This should workWow! So all one has to do is to use a shell to run the command! Isn't it a pity I did not give this solution in reply #3?You old sabre rattler! ;-)

  • How to execute unix command line from cocoa?

    how to execute unix command line from cocoa?
    for example, if I want to call "ping" from cocoa, how should I do it? and how can I obtain the return value?
    thank you.
    Power G5 Quad Mac OS X (10.4.3)

    The following article may also help:
    http://cocoadevcentral.com/articles/000025.php
    Mihalis.
    Dual G5 @ 2GHz   Mac OS X (10.4.6)  

  • How to execute a Command Prompt command from J2SE code executing on Windows

    How to execute a Command Prompt command from J2SE code executing on Windows??
    Please help me

    [http://java.sun.com/docs/books/tutorial/getStarted/]
    ~

  • How to execute  make  Command?

      Run in the terminal inside the  make command,prompt:"-bash:make:command not found"  My system version is Mac OS X 10.7.3 Xcode Version is 4.3.
      How to execute  make  Command?
                                    thanks!!

    I switch to / usr / bin directory also did not find the make  only to find a makeinfo. Google to find relevant information, if installed Xcode will be able to run make, but now does not work.
    But still thank you very

  • How to execute Dos Command 'Pause' from Java ?

    How to execute Dos Command 'Pause' from Java ?
    I have read the article in javaworld for Runtime.exec() anomalies.
    Can someone please give an insight on this?

    Thanks Buddy!
    That was very useful. Even though its a simple
    solution, I never thought about that.Bullshit! Reread reply #7 of http://forum.java.sun.com/thread.jspa?threadID=780193

  • Execute Shell command in Panel SDK Mac

    Hi,
    I´d like to execute the following task with a Panel:
    • render the active sequence
    • when finished send the output video file to another application using Apple Script
    The Panel SDK Examples are a great start. So the missing part is, how can I send a shell command that executes an AppleScript?
    In the ExtendScript Toolkit I found a function that looks promising. But executing this script only pops up an alert window saying "failed". Here´s the code:
    var test = UIAutomationSupport.helper.executeConsoleCommand("ls -l");
    alert(test);
    So does Premiere has an equivalent function like system.callSystem() in After Effects?
    Thanks,
    Thomas

    Bruce, thanks for your support!
    For those who are interested what bbb_999 refers to, here is how you can execute a shell command (in the example I use "osascript" to launch an AppleScript file):
    In your html file you simply write these simple lines of code
    <script type="text/javascript">
        function executeShellCommand(){
              var result = window.cep.process.createProcess('/usr/bin/osascript','/Users/myUserName/Desktop/test.scp t');
              alert(result.data+" "+result.err);
    </script>
    The first argument of createProcess() is the path to the shell tool.
    That´s all. Hope this helps others.
    Thomas

  • Execute shell command from within pascal code

    Hello there,
    I am trying to execute a shell command from within my pascal code. I use XCode together with FreePascal. I have tried something like:
    exec ('program', 'options');
    adding the 'Dos' unit to the Uses clause of my program.
    Thus, e.g.,
    exec ('mkdir', '/A')
    to create a directory with the name 'A'.
    However, my attempts so far were unsuccessful. Can anyone help me on this, and perhaps provide a simple example of how to do it right?
    Thank you in advance,
    Shane

    In the mean time, I found the problem myself. I am just posting the solution here for anyone that is interested. My original solution was correct, in that the 'Dos' Unit must be added, and that the right command is 'exec'. There was however a problem with the correct path to the program that I wanted to invoke. In the shell, this program was accessible from anywhere. However, in the 'exec' command, the full path to the program must be given. Since I am not a Unix expert, I don't know the reason for this.
    So, in summary, the solution is:
    Uses Dos;
    begin
    exec ('full path to program', 'program options');
    e.g.: exec ('/bin/sh', '/run.sh') to process the commands in the file /run.sh
    end
    Hope this may be of help to anyone else.
    Shane
    Mac OS X (10.3.9)
    Mac OS X (10.3.9)
    Mac OS X (10.3.9)

  • Executing shell command

    hi
    i waould like to know if any one can tell me how to execute a shell command or call an from within a class file.
    i am required to write a program which creates a servlet file internally everytime it is run.
    i want to know how to execute the shell command in java so that i can compile that file after creating the file from within the class file and not leave it to the user to do it.

    Runtime.getRuntime().exec("<your_command>");

  • How to execute unix command through odi and store the result in table

    I have to reconcile  if data is loaded in table from csv file or not . I have to create a oracle data integrator package/interface/procedure to execute unix command to count number of rows in the csv files and store the count result in a table then i have to query the loaded table and count number of rows there and store in the table and have to compare is counts are same or not,  Please assist me how to make package/interface/procedure to  execute unix command and store result in oracle table.
    Thanks in Advance

    Use ODI OS command tool in the ODI package.
    create an interface in ODI using LKM File to Sql and the output file generated with the csv file's row count as a source and the db table(where the count needs to be stored) as a target

  • How to execute dos command in Java program?

    In Perl, it has System(command) to call dos command.
    Does java have this thing?
    or any other way to execute dos command in java program?
    Because i must call javacto compile a file when the user inputed a java file name.

    Look in the Runtime class, it is implemented using the Singleton design pattern so you have to use the static method getRuntime to get its only instance, on that instance you can invoke methods like
    exec(String command) that will execute that command in a dos shell.
    Regards,
    Gerrit.

  • How to execute unix command from ODI Procedure

    Hi,
    I am trying to execute below unix command from ODI Procedure (Command on Target tab) but I am getting the error "java.io.IOException: Cannot run program "cd": error=2, No such file or directory" but when I try to execute the same command using OdiOSCommand, it is executing successfully. I don't want to use shell script to execute this command. Is there any specific syntax am I missing to execute this command from ODI procedure?
    cd /project3/tmt/;ls *.dmp > dmplist.lst
    Please help me on this...
    Thanks
    MT

    Hi nahlikh,
    Thank you for the reply.
    I used below command in Procedure but still getting the same error as "java.io.IOException: Cannot run program "OdiOSCommand": error=2, No such file or directory".
    OdiOSCommand "-COMMAND=cd /project3/tmt/;ls *.dmp > dmplist.lst"
    as I mentioned earlier if I use the command cd /project3/tmt/;ls *.dmp > dmplist.lst in OdiOSCommand tool it is executing successfully without any issues.
    any thoughts appreciated to get a solution for this issue.
    Thanks
    MT

Maybe you are looking for

  • OSB: problem when starting a managed server in an OSB cluster

    Hi, I used the configuration wizard to setup a very simple domain, containing a cluster with a managed server. When I start the managed server from the console I get prompted for the boot user and password. I specify the values I defined during the i

  • Collect statement not working

    Hi,            My collect statement is not working. Kindly let me know what is the other way to add one filed in the loop. thanks Moderator message - Please ask a specific question - post locked Edited by: Rob Burbank on Nov 19, 2009 9:24 AM

  • Last time I updated firefox Yahoo has taken over. I hate yahoo and would like to remove it is that possible?

    when I uploaded the new version of firefox yahoo has taken over. It over rides everything and I want to remove it is that possible to keep firefox but remove yahoo? When I put a address in the address bar yahoo over rides it and it goes to a yahoo pa

  • My Glass screen broke  please helppp!

    I broke my glass screen I am so upset. I spent 183 dollars on the protection plan and the computer is almost three months old.... And when i  i called they told me it would be a couple hundred to get it fixed. Has anyone had a similiar problem with a

  • Spam or virus message

    I bought a photosmart 6510.  When I try to send a photo from the phone to the printer to the printer's email address it comes back reading spam or virus.  Then I tried to send a photo from my photos on my iphone and I wrote in the subject area and se