LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to run shell script with sudo user from external scheduler (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-run-shell-script-with-sudo-user-from-external-scheduler-4175436279/)

techshell81 11-08-2012 10:59 AM

How to run shell script with sudo user from external scheduler
 
Hi,

We have using version linux 5 operating system.

my oracle installed under "admin" user.

we have to monitor my oracle database is available or not from my application server.

for this we prepared the shell script and put oracle sql command inside the shell script.
this shell script we have to run from external scheduler.

i am runing shell script from external scheduler with my login but i am not able to use oracle(is installed under admin)


Please any one tell me how to run to shell script sql command with sudo user from external scheduler.

Thanks

teckk 11-08-2012 11:08 AM

Quote:

with sudo user
User has to have permissions in the sudoers file to be able to run as root.
http://linux.die.net/man/8/sudo
http://linux.die.net/man/5/sudoers

Code:

## User privilege specification
##
root ALL=(ALL) ALL

## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL

## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL

## Uncomment to allow members of group sudo to execute any command
# %sudo        ALL=(ALL) ALL



All times are GMT -5. The time now is 07:23 AM.