Visit Our UNIX and Linux User Community


Comparing directories on different unix servers


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Comparing directories on different unix servers
# 8  
Old 11-01-2009
Ah I get it, sorry I missed you were trying to diff the contents of the directories.

I have not seen the <(..) syntax before, is this peculiar to 93? I use 88 at work so would like to know if this works on that version.
# 9  
Old 11-01-2009
Quote:
Originally Posted by steadyonabix
Ah I get it, sorry I missed you were trying to diff the contents of the directories.

I have not seen the <(..) syntax before, is this peculiar to 93? I use 88 at work so would like to know if this works on that version.
It is called process substitution. I took a look at the man pages. Apparently it is a feature of ksh88 too. However, the man pages say:
Quote:
This feature is only available on versions of the UNIX operating system that support the /dev/fd directory for naming open files.
So might the reason that it is not working on those AIX systems be that /dev/fd is missing?
# 10  
Old 11-01-2009
Thanks

That may be why I haven't seen it. The code I work on has to run on Solaris and AIX.

I will try it anyway

Cheers
# 11  
Old 11-02-2009
Quote:
Originally Posted by steadyonabix
In Korn shell I would expect something more like this: -

Code:
diff <$(ssh server_name 'find /home/x136873 -type f')  <$(ssh server_name 'find /home/x136873 -type f')

The $ gets rid of the unexpected ( error but I think it still wont work as the diff is expecting file names
Yeah, got a "No such file or directory" error... Least its a little further..

Ran the
Code:
(echo ${.sh.version}) 2>&- || echo ksh88

and it returned ksh88

Also just tried
Code:
diff folderA <$(ssh user@server_name /home/x136873/folderA)

Get the error "diff: two filename arguments required"

Also trying the rsync --dry-run command too..
Code:
rsync -avvc --dry-run -e ssh * user@server_name:/home/folderA/

Almost have this working... having a problem getting the ssh key to work this way tho.. Also getting the message "unexpected EOF in read_timeout" Think this error is more to do with ssh tho..

Not sure where to go from here.. I mean am I tackling the issue from the wrong direction.. Is there some other way of comparing directories that reside on different unix servers another way?

Last edited by Jazmania; 11-02-2009 at 11:19 AM..

Previous Thread | Next Thread
Test Your Knowledge in Computers #1010
Difficulty: Easy
The number 200 in base 8 equals 128 in base 10.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Comparing two directories with diff

Hi all, I have 2 directories on two different servers. I am trying to find out what is missing from directory X and what is missing from directory Y. they should both have the same exact files in them. I understand some files may be missing from both directories on each server. I am not sure... (8 Replies)
Discussion started by: jeffs42885
8 Replies

2. UNIX for Beginners Questions & Answers

Comparing time differences between 2 Solaris servers

Good day to all. I'm relatively new in using the Sun Solaris OS. I would like to request your expertise in helping to solve a problem that I have at work. Not sure if this has been asked before but I have tried searching through the internet to no avail. Basically I have 2 sun solaris... (8 Replies)
Discussion started by: Fossil_84
8 Replies

3. Shell Programming and Scripting

Comparing 2 UNIX directories

Hello, I'd want to compare the content of 2 directories in unix. I use the diff command like this: diff /home/user/AAAAA /home/user/BBBBB It works fine, but when a same file is in both directories and they are diferents, I'd want to see only that it is diferent and not all... (4 Replies)
Discussion started by: nolo41
4 Replies

4. Shell Programming and Scripting

Comparing files names in directory over two servers

Hi folks I need to write a shell script to check whether source and the destination has the same files. The source and destination are over two servers and connecting through ssh. It should even compare the date i.e, the complete file name, date stamp and size should match. Should list out all the... (3 Replies)
Discussion started by: Olivia
3 Replies

5. Shell Programming and Scripting

Comparing Virtual servers

Hi I need a script to run on a Solaris server to confirm if it is a physical server or a Virtual server please help Mandaken (0 Replies)
Discussion started by: madmacher
0 Replies

6. Homework & Coursework Questions

comparing 2 directories

i have been asked to write a bash shell script comparing two directories and sed or awk should not be used in this assignment. compdir will compare filenames in two directories, and list information about filenames that are in one directory but not the other. The information listed will be a long... (1 Reply)
Discussion started by: soccerball
1 Replies

7. UNIX for Dummies Questions & Answers

comparing the content of two directories

Hello I want to compare the content of two directories recursively to check if the two directories have the same files. How can I do that? (2 Replies)
Discussion started by: xyzt
2 Replies

8. UNIX for Dummies Questions & Answers

Comparing directories via ftp

Hello! I am trying to compare a list of files in 2 directories - one on our unix server (I'll call it 'ours') and one on a site we ftp to (I'll call it 'ftp'). I need to make sure that after we ftp, the names that we put out there match the names we have on our side. I was thinking to create a... (1 Reply)
Discussion started by: tekster757
1 Replies

9. Solaris

comparing 2 Solaris servers

hello has anyone built a script that compares 2 Solaris servers? CPU, memory, swap, memory variables in /etc/system, Solaris version Could you please advise on how to make such a comparaison? thanks (9 Replies)
Discussion started by: melanie_pfefer
9 Replies

10. Shell Programming and Scripting

moving directories to new directories on multiple servers

Hi - I am new to unix scripts...I need to move several directories on multiple servers to new directories. (0 Replies)
Discussion started by: mackdaddy07
0 Replies

Featured Tech Videos