Hi All,
I need to compare two files, the two files available on 2 linux servers.
say, file_1 on server A
file_2 on server B
one way use ftp to download the file and compare it, other than this is there any other way?
---
A)
| Well, there is a tool called rsync that can be used to synchronize directories between 2 remote serves. The differential option is quite clever and can find out if 2 files are different without having to transfer the all file and what bytes need to be copied in order to make the files equal. If you just need to know if the files are different you can just calculate the checksum locally and then on the remote server. If the two servers have different OSes you have to chose "your_checksum_program" wisely make sure you got the same output (including spaces, tabs and so on) when check summing the same file or else the test "$LOCALCK" = "$REMOTECK" will fail. You may have to do some testing to make sure that no extra text goes into REMOTECK, system headers, motd, etc can be a pain sometimes. If by some reason you can't get a clean result into REMOTECK, you may run the checksum on the remote file and redirect the output to a temp file on the remote system and then get that file with scp. If you just need to know if the files are different and don't need to do it in a script, do a checksum locally, then login in the remote server and do the same thing. Ant?nio Vasconcelos Servi?o Unix SSI UEG2 ? Gest?o de Sistemas Distr?buidos Grupo Caixa Geral de Dep?sitos 55 67 81 email@removed Reserva e Confidencialidade: Esta mensagem, assim como os ficheiros eventualmente anexos, ? reservada aos seus destinat?rios, e pode conter informa??o confidencial ou estar sujeita a restri??es legais. Se n?o ? seu destinat?rio ou se recebeu esta mensagem por motivo de erro, solicitamos que n?o fa?a qualquer uso ou divulga??o do seu conte?do e proceda ? elimina??o permanente desta mensagem e respectivos anexos. Limita??o de Responsabilidade: A CGD n?o est? vinculada ao conte?do desta mensagem, a menos que a informa??o seja subsequentemente confirmada por um representante autorizado da CGD. Apesar de todos os cuidados adoptados pela CGD no sentido de preservar a seguran?a das mensagens por si enviadas, a protec??o da informa??o enviada por via electr?nica n?o pode ser garantida pelo remetente. Por estas raz?es, a CGD n?o se pode responsabilizar por eventuais erros, imprecis?es ou omiss?es desta mensagem, e ficheiros eventualmente anexos, ou por qualquer facto suscept?vel de afectar a respectiva integridade, autenticidade ou confidencialidade. |


