The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
error in running shell script in cron sari Shell Programming and Scripting 3 04-16-2008 05:09 AM
mv command is giving error in shell script gammit Shell Programming and Scripting 5 12-13-2007 03:56 AM
inconsistent ls command display at the command prompt & running as a cron job rajranibl SuSE 5 07-30-2007 09:26 AM
Running "wall" command from cron xadamz23 Shell Programming and Scripting 1 05-27-2005 09:43 PM
Error when running the make command nattynatty UNIX for Advanced & Expert Users 2 03-25-2003 05:30 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-12-2008
visingha visingha is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 20
Exclamation Cron job giving error while running SSH command

Hi All,

The script which i am using to SSH to remote server is working fine when i run is using ./ but when cron runs it it gives error that "ssh: not found"

please help!!!
  #2 (permalink)  
Old 09-12-2008
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,804
Use the complete path to ssh. On our system it is /usr/bin/ssh.

Code:
which ssh

will give you that information
  #3 (permalink)  
Old 09-12-2008
visingha visingha is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 20
Hi jim,

Thanks for the response but could you please elaborate it.

The local server doesn't have /usr/bin/ssh though the remote server has this(/usr/bin/ssh).

How should I modify my code. Below is the code which i am using:

ssh username@remote_server <<EOF
move files from one folder to another
EOF
  #4 (permalink)  
Old 09-13-2008
visingha visingha is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 20
Hi Jim,

Thanks for the reply. The solution worked really great.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:16 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0