Compare md5sum two servers' setup


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Compare md5sum two servers' setup
# 1  
Old 07-14-2016
Compare md5sum two servers' setup

I'm trying to think of a way to compare two boxes and make sure their files will be the same. There may be extra files on one side and some on the other.

I also need to make sure the file content is identical.

So far I've gotten this to create a file

Code:
 find /directorypath/ -type f -name "*" | xargs -n 1 md5sum >comparefile.txt

Code:
3e799eb050da202e454b5691f978d84b  /apps/RWS/jboss-222beta/RWS-db2-400-xa-ds.xml
ba813e839cd5da0fe2ad6cd673d36bdc  /apps/RWS/jboss-222beta/CustomInstall.script
5c37052421ac10f4201f33383dfa9713  /apps/RWS/jboss-222beta/deploy/BIRestServiceDynamic.war
ed98c36f719d2e227b0401963873f96c  /apps/RWS/jboss-222beta/deploy/mail-service.xml
95c8877f45cfc5fb1b180af711ef6214  /apps/RWS/jboss-222beta/deploy/HistoricalUserQualityService.war
e92758e35d1a5e6bdb1ba76bd062232e  /apps/RWS/jboss-222beta/deploy/properties-service.xml
fef27f2f1818242a6def643c6b6878cf  /apps/RWS/jboss-222beta/deploy/RWSEmailService.ear

So I can run this on two different boxes but how can I get them to do a compare on the hash in a readable format and then show extra files on one side vs. the other.

Thanks for any help
# 2  
Old 07-15-2016
sort either result file and then diff them?
# 3  
Old 07-15-2016
Hi.

The utility rsync:
Code:
       Rsync finds files that need to be transferred  using  a  "quick  check"
       algorithm  (by  default) that looks for files that have changed in size
       or  in  last-modified  time.

excerpt from man rysnc

It allows an option:
Code:
        -n, --dry-run               perform a trial run with no changes made

Best wishes ... cheers, drl
This User Gave Thanks to drl For This Post:
# 4  
Old 07-20-2016
Yeah they may not have changed in size, there may be one character difference, so the size might be identical. That's why I was trying to use md5sum to compare and make sure everythying is identical.....
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare two md5sum

Hello, First of all I want to apologize because i'm not a admin or coder and maybe all my efforts to write only this small script in my life would need one week full time reading man pages and forums but... I don't have the money to offer me to get this time and the script I want to do seems... (5 Replies)
Discussion started by: toscan
5 Replies

2. UNIX for Beginners Questions & Answers

Expect in Bash - and then compare md5sum

I'm running on a staging server. I will need to use expect and I think ssh or scp to the other boxes. I need to see something like this....Enter:Host 1 Enter:Host 2 Enter full directory path to compare: example /apps/acd/jboss-customer1/ Enter User Id: Enter Password: ( Assumes... (6 Replies)
Discussion started by: xgringo
6 Replies

3. UNIX for Advanced & Expert Users

How to setup sftp beteen two servers?

Hi Could you please help me out how to configure between two server I don't have admin idea to setup the Sftp server the requirements is we want to send a file to vendor so we need sftp configuration so that can we can send file through sftp Please let me know what should I ask to vendor... (1 Reply)
Discussion started by: jagu
1 Replies

4. Shell Programming and Scripting

Compare files in directories with md5sum

And not to start. I can compare files, that's easy. The problem is that I compare files in a directory, and check if these files exist in another directory. The problem is that the file names are not the same. So I have to compare with "md5sum" or something similar. How I can do? All this in... (7 Replies)
Discussion started by: Jomeaide
7 Replies

5. Shell Programming and Scripting

Compare files in 2 servers

I need to compare same set of files in 2 different servers and generate a list (in STDOUT) which contain all the files that have changed. I don't have permission to create any temp files or folders in either servers. - One option is to use ' if '. But for this I need to move file1 to one server... (1 Reply)
Discussion started by: vskr72
1 Replies

6. Shell Programming and Scripting

Compare two directories in different servers

I have a requirement. I need to write a shell script which will compare two directories residing in two different servers (SERVER A and SERVER B) and list out the discrepancies if found any. Script will be running from SERVER A. Please help. (2 Replies)
Discussion started by: freakysk
2 Replies

7. UNIX for Dummies Questions & Answers

How to setup NTP on unix and linux servers?

I have a hostname/ip of our network time server. What are the steps to take to set each server up to synchronize the clocks? Thanks (4 Replies)
Discussion started by: ChadKam
4 Replies

8. Solaris

directory compare in two different servers

How can we get the directory tree along with the size in two different servers and find the difference between the list..?? Eg, Server1 dirTree1 -size Server 2 dirTree2 -size how can we find the directory tree with its size, and find the difference, where the servers are different... (1 Reply)
Discussion started by: vikram3.r
1 Replies

9. Shell Programming and Scripting

compare 2 Solaris servers

hello I want to compare settings on 2 servers. 1] what is the command to ssh on servers and execute commands such as prtconf | grep Memory uname -a 2] Do you have a built-in script that executes this service? thanks. (2 Replies)
Discussion started by: melanie_pfefer
2 Replies

10. Shell Programming and Scripting

compare directories on two servers

We are migrating from one server to another. We have encountered problems during testing where some files are missed in the restore and/or permissions do not get restored correctly. I have been manually checking these items in directories, but its a big system. And this is just the test phase.... (1 Reply)
Discussion started by: MizzGail
1 Replies
Login or Register to Ask a Question