The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
check ssh connection to remote host praveenbvarrier Shell Programming and Scripting 6 10-06-2008 01:46 PM
Sending Commands to a Remote Host safetytrick UNIX for Dummies Questions & Answers 3 08-18-2007 07:29 PM
How to delete the files from local host to remote host krishna176 SUN Solaris 3 03-24-2007 04:48 PM
tnsping at local and remote host? milo Shell Programming and Scripting 1 03-16-2007 11:12 AM
Sending tar output to a remote host thumper UNIX for Dummies Questions & Answers 3 03-08-2006 12:10 PM

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 07-20-2005
redlotus72 redlotus72 is offline
Registered User
  
 

Join Date: Feb 2005
Posts: 69
How to specify the remote host?

Hi,

I want to compare 2 set of dierectories, one is current host, other in remote,

I am tring like this:

diff $HOSTTOBACKUPH:$SOURCEHR $DR_BACKUP_DIR_H/hourly.0

I am getting fowlling error>
diff: ctlrws123:/home/arbuser/temp2/mscdr/sor_d: No such file or directory

how to specify the remote host in deff command?
  #2 (permalink)  
Old 07-20-2005
TioTony's Avatar
TioTony TioTony is offline Forum Advisor  
Bit Pusher
  
 

Join Date: Oct 2001
Location: Southern California
Posts: 332
Since it appears from your post that both files are on the same remote host you could use 'rsh host diff file1 file2'.
  #3 (permalink)  
Old 07-21-2005
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
The diff command is not equipped to handle files residing on remote hosts. There are a few ways that you could go about this. All involve getting the remote file to the local host, or sending the local file to the remote host.

This is how you can do it using rsh:
Code:
rsh -l username remote_host cat full_path_to_remote_file > /tmp/remote_file
diff /tmp/remote_file local_file
### take further action depending on the output?
This is how you can do it using ssh:
Code:
ssh username@remote_host cat full_path_to_remote_file > /tmp/remote_file
diff /tmp/remote_file local_file
### take further action depending on the output?
Note that the '>' will create a file named /tmp/remote_file on the local system. To create remote files using either rsh or ssh, you have to escape the '>' as '\>'
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 07:31 AM.


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