Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

executes host commands thru apex

user468Jun 16 2010 — edited Jun 16 2010
HI ALL
I have a function called rum_cmd which executes host commands.(by using a util java) like this code
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:3069633370832
the major different is that my function return the message of the system.
example
if i'm running a script called :cs-message
#!/bin/bash
echo "start script "
i'm running the function in pl/sql process like this
begin
:p98_output :=run_cmd ('/bin/bash -l ' || cs-message);
end;
the function will return : start script .
question
i have a script cs-backup-file which backup files like this :
#!/bin/bash
cp /usr/mng/file_mess*.txt /usr_backup/mng/.
cp /usr/mng1/file_mess*.txt /usr_backup/mng1/.
cp /usr/mng2/file_mess*.txt /usr_backup/mng2/.
. 
.
.
i want to run this script thru the apex like this
begin
:p98_output :=run_cmd ('/bin/bash -l ' || cs-backup-file);
end;
two question :
1.since we're talking about backup , is this a good idea doing it thru the apex ?
2. if so ,
how shell i know if the script end succesfully, and copied all files ?,
and i'm not talking about an echo command that i will write in the start of the script , but i'm asking about a message from the server , or other related solution
thanks in advanced
Naana
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 14 2010
Added on Jun 16 2010
2 comments
763 views