-   Linux - General (
-   -   Cannot run shell script on the remote server (

haresh_dba 04-14-2007 06:40 AM

Cannot run shell script on the remote server

I`m unable to execute my shell script on the remote db server for monitoring. However i`m able to connect the remote server but the scripts are not executing remotely.

I would like to run the scripts on the remote box

Please help

MensaWater 04-14-2007 08:40 AM

You can't execute a script from a local box on a remote box. You can however put in commands to execute on a remote box from the local box OR you can copy the local script to the remote box then use the local box to tell it to run there.

Say you had a simple script and named it ""

ls -l
df -h

This script should run fine on the local box just by typing "./". However if you tried to run it remotely by typing:

ssh user@remotehost ./

It wouldn't work because doesn't exist on the remote. You could simply copy this to the remote host and then run it.

Alternatively you could modify the script:

ssh user@remotehost "/bin/ls -l"
ssh user@remotehost "/bin/df -h"

Here you're telling it to execute each of the commands of the script remotely. The downside of this is that if you don't have an ssh trust setup it will prompt you for the password each time it executes and ssh in the script.

XavierP 04-14-2007 09:26 AM

Moved: This thread is more suitable in Linux-General and has been moved accordingly to help your thread/question get the exposure it deserves.

All times are GMT -5. The time now is 07:47 PM.