LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-14-2009, 06:02 PM   #1
need
LQ Newbie
 
Registered: Aug 2009
Posts: 2

Rep: Reputation: 0
How to call Shell Script on a remote server with remote servers env variables


Hello,

I need to call a shell script on the remote server which uses hadoop command. Now the remote server is a part of hadoop cluster and its environment is set up such that
"hadoop fs -ls" works on it.

But when I call a shell script from my own linux machine on this remote server that uses above command it fails saying hadoop command not found.

My question is : What do I need to do in order to call a script on the remote server in such way that it uses environmental variables from the remote server.

Currently, i use ssh <user>@remote <full path to shell script > to launch..
If there's any other way to call the shell script, please let me know

Thanks in advance!
 
Old 10-14-2009, 09:37 PM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,311

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
You need to source the login script eg ~/.bash_profile as part of the remote cmd.
Alternately, just write a brief script on the remote system that uses the full path and call that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh - using variables in call to start remote script from local script babag Linux - Networking 2 06-03-2008 05:50 PM
FTP files to remote server with a shell script Pezzoni Linux - Software 2 06-27-2007 08:01 AM
Cannot run shell script on the remote server haresh_dba Linux - General 2 04-14-2007 10:26 AM
ssh : remote command execution doesn't work for modifying env variables pypieuvre Programming 10 02-24-2006 10:50 AM


All times are GMT -5. The time now is 10:14 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration