Script to communicate from UNIX server to windows server

I have two servers linux and windows and i want to compare files which are in unix server that to windows server and find out which are missing

that means i have 50 files with 6000 records in each file on linux server and i want to verify weather these 50 files are present in windows server with no error i.e. with respect to file name ( file name is same on both servers),file size and records inside the file and find out any missing.

Plz provide the logic how to do this

Dear sagar_1986,

I have a few to questions pose in response first:-

  • Is this homework/assignment? There are specific forums for these.
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)

Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future. You need to decide first how you want to do this. Some suggestions would be:-

  • Share the unix directory and map it on Windows, comparing there, or the reverse
  • Get a list of the files on windows server, then copy that list to unix to compare, or the reverse
  • Other ways....

Which way seems most logical to the servers you have?

We're all here to learn and getting the relevant information will help us all.

Please keep in mind that windows has different line terminators than *nix does; so equal file sizes may not be a condition that can be met.

Thanks for the reply,

I can write few shell script but i have no idea in communication between two servers with different OS.This is my home work.

what i have thought is to list all the files on windows server date wise or by file name ( as file name is same on both servers ) and then compare them on linux server and if some mismatch is there then find the missing file or the file with different file size ( 6000 records in each file ) and then compare records in it.
I am sill confused how to do this, as some other post on different sites says telnet is not secured ( as may be expect script can work) and i dont know how to use ftp or any else protocol . Plz provide me some logic or initial start from where i can initiate.

linux server is reference server and can be considered main reference for files and records.

the methodology which i have thought is to grep all the file names which are generated on that date ( say on 23 oct 2015) on linux server then get list of files which are available on windows server with same file name,compare them and find missing file name or missing records in file by matching the file size ( 6000 records in each file).

plz help me to initiate

is it safe to enable telnet

How to communicate with the server is your choice, and depends a great deal on the Windows server. File shares is a common method to bridge Windows and UNIX but Windows must export the relevant folders for UNIX to be able to access them.

Whether it's safe to enable telnet depends entirely on what you do with it.