3 Replies Latest reply: Jan 3, 2013 11:51 PM by Shr12345 RSS

    Is there a way to execute remote shell scripts throught APEX 4.1

    Shr12345
      Hi,
      Is there a way to execute remote shell scripts/perl script through APEX 4.1?
      I use Application Express 4.1.1.00.23
        • 1. Re: Is there a way to execute remote shell scripts throught APEX 4.1
          fac586
          Shr12345 wrote:

          Is there a way to execute remote shell scripts/perl script through APEX 4.1?
          I use Application Express 4.1.1.00.23
          What do you mean by "remote"? Where do you want to execute the scripts?
          • 2. Re: Is there a way to execute remote shell scripts throught APEX 4.1
            Jozef Demovic SVK
            Hi,

            I use it this way:
            -- Shell Script.
            BEGIN
              DBMS_SCHEDULER.create_program (
                program_name        => 'sync',
                program_type        => 'EXECUTABLE',
                program_action      => '/some_loc/some_dir/sh/sync.sh',
                number_of_arguments => 0,
                enabled             => TRUE,
                comments            => 'SH script where is link to another remote sh script #!/bin/sh
            ssh remote_user@host ./some_dir/bin/replicate.sh');
            END;
            /
            
            -- Create the schedule.
            BEGIN
              DBMS_SCHEDULER.create_schedule (
                schedule_name   => 'sync_schedule',
                start_date      => SYSTIMESTAMP,
                repeat_interval => 'freq=daily; byhour=18; byminute=0; bysecond=0',
                end_date        => NULL,
                comments        => 'Repeats daily on 18:00 - when somebody forgot to run it manualy');
            END;
            /
            
            -- Job defined by an existing program and schedule.
            BEGIN
              DBMS_SCHEDULER.create_job (
                job_name      => 'sync_job_definition',
                program_name  => 'sync',
                schedule_name => 'sync_schedule',
                enabled       => TRUE,
                comments      => 'Job defined by an existing sync program and schedule.');
            END;
            /
            There is used program definition, scheduler, job ...

            I hope it will bring some help.

            Regards
            J :D
            • 3. Re: Is there a way to execute remote shell scripts throught APEX 4.1
              Shr12345
              Hi,
              I will try this. jozef_SVK

              Edited by: Shr12345 on Jan 3, 2013 9:51 PM