Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare 2 unix servers 2

Status
Not open for further replies.

anushka04

Technical User
Jul 7, 2005
28
GB
Hi
I need to compare two servers to see if there is deference in software installed (OS and Application). One is the test server and the other is the live server.


I tried to use the find unix command ( find . –print > myfile ) to dump the file, but this file only shows the file name and path and not the size or modification date.


Any suggestion would be appreciated.


AIX 4.3
 
find / tmp -type f -o -type d -exec ls -l {} \; > /tmp/list

then diff

or you could use rsync to force the servers to be the same.

Mike

Unix *is* user friendly. It's just selective about who its friends are.
 
I am assuming that this is an AIX server and try to compare excutables on OS only. If it is database, then you stuck with an answer from me

Use a combination of lslpp and rpm (see below) and writing a script that traverses the directory structures that takes a diff or cksum of each file depending on type (binary or txt). Then comparing the cksum &/ diff results of each server together.

lslpp -w <file name including path>
rpm -qf <file name including path>


Before you ask, I don't have script that does this!


Regards

Brian
 
You could also get a copy of cfg2html to compare packages / versions / hardware.

Mike

Unix *is* user friendly. It's just selective about who its friends are.
 
Thanks to everyone so far I will test this and let you know

Mike what does this commad exactly do
find / tmp -type f -o -type d -exec ls -l {} \; > /tmp/list

Does this just list the file deatils on file list?

Any suggestion where I get this form (cfg2html)
 
Yes it'll do a ls -l from root down. Take a look at awk (or ask us ) if you need to pick out certain columns. If you compare the two servers I would imagine every line would be different due to the file creation times so maybe filter out $2 & $8

Mike

Unix *is* user friendly. It's just selective about who its friends are.
 
Thanks mike, my strong point is to unix and you may find me asking silly questions.

awk? not sure what you mean.

Can please tell me how I can filter $2 and $8
Thanks
 
Mike
in this do i need the /tmp in there or can i leave that out



find / tmp -type f -o -type d -exec ls -l {} \; > /tmp/list


Thanks
 
No I just used /tmp to test my command line (So I didn't get loads of output) if you want to create a complete list of files/directories on your system you need to start from / (root).

As for awk; first read the man page for awk, to show you what it does try this

ls -al /tmp

and now this

ls -al /tmp | awk '{print $1 $3 $9}'

$1 being the first column
$3 being the third
.........

awk is a very powerful command and there are some very good awk people (P5wizard & PHV to name two) around on this forum and in the awk forum.

Mike

Unix *is* user friendly. It's just selective about who its friends are.
 
Had a think about this some more, if I were comparing systems this is what I'd be looking at (Not a complete list by far).

Volume Group info
File systems info
Files
Installed Software
Configuration /users/groups/network/nfs/tcp
Hardware

Mike

Unix *is* user friendly. It's just selective about who its friends are.
 
Thanks Mike for the nice information.

You are always helpful :)

I would add You the list you've just mentioned (P5wizard & PHV)

:)

Regards,
Khalid
 
find / -ls >/tmp/filename

would also work.

Mike

Unix *is* user friendly. It's just selective about who its friends are.
 
Mike

what would be the complete command using awk and

find / tmp -type f -o -type d -exec ls -l {} \; > /tmp/list

would this work
find . -type f -o -type d -exec ls -al {} \; | awk '{FS=" "; printf("%s %s %s\n",$1, $3, $9); }'
 
Yes that works (I've just tried it) would use ls -Al instead of ls -al that way you don't get the . & .. directories

Mike

Unix *is* user friendly. It's just selective about who its friends are.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top