compare zip files from a local to remote server


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers compare zip files from a local to remote server
# 1  
Old 01-03-2012
Bug compare zip files from a local to remote server

Good evening

I need your help pease

I know there are 2 commands(diff, or cp) to compare files in a directory. but the question arises:

1. can i compare zip files or ive got to unzip them?
2. how can i compare 2 files from a local to a remote server? (is there any special commad or ive got to code?).

Id appreciate your help
# 2  
Old 01-03-2012
Read this. You may find it useful:

The Power of Z Commands – Zcat, Zless, Zgrep, Zdiff Examples (link removed)
# 3  
Old 01-03-2012
quickest way to compare files, regardless of location, is to do "ls -l" and/or "sum" on them and looking at the output ... if the output is exactly the same, it is very probable that they are the same ...

if still unsure,

i suggest you test item 1 yourself by creating 3 zip files -- 2 of which are exact copies (i.e., cp -p 1.zip 2.zip) and 1 different -- and checking output from diff and cmp ...


good luck!
# 4  
Old 01-03-2012
Thanks for your explanationn both all you, its useful

But im still with de same doubt because:

1. zcommads is a powerful linux commad but no unix, but i need to compare n zip files in a local (Unix server) to Remote (Linus Server)

2. the 2nd explanation is OK but what if i have to compare at least 10 or more files from source to destination server, so it would be a kind of a ackward

Thanks again for your further help
# 5  
Old 01-03-2012
create a script with a for loop (similar to code below) to connect to the remote servers and run a ssh command to look at "ls -l" output ... make sure you list your remote servers in the correct hostlist ...
Code:
#!/bin/sh

LIST='/home/user/hostlist'
USER='user'
FILE='/home/myzipfile'

hostname
ls -l $FILE
for HOST in `cat $LIST`
do
    ssh $USER@$HOST "hostname; ls -l $FILE"
done

exit 0

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Best way to transfer files to remote FTPS server instead of local FTPS server

Hi, I am working on an application which runs on an Informatica Red-Hat 5.10 Linux Server. The application involves several Informatica ETL workflows which generate 100s of Text files with lot of data. Many of the files will each be up to 5 GB in size. Currently the Informatica server itself... (7 Replies)
Discussion started by: waavman
7 Replies

2. Shell Programming and Scripting

How to Append the output of a script running in remote server to a file in local server?

Hi guys, So i am in server1 and i have to login to server 2, 3,4 and run some script there(logging script) and output its result. What i am doing is running the script in server2 and outputting it to a file in server 2 and then Scp'ing the file to server1. Similarly i am doing this for other... (5 Replies)
Discussion started by: srkmish
5 Replies

3. Solaris

Script to get files from remote server to local server through sftp without prompting for password

Hi, I am trying to automate the process of fetching files from remote server to local server through sftp. I have the username and password for the remote solaris server. But I need to give password manually everytime i run the script. Can anyone help me in automating the script such that it... (3 Replies)
Discussion started by: ssk250
3 Replies

4. UNIX for Dummies Questions & Answers

How to copy files from remote server to local?

Hi experts, I 'm newbie to unix world, now I have task to copy the latest files from remote server to my local. I believe this must be very common request in this community. I want you do it one more time for me please. My requirement is something like this: I receive files in the below... (3 Replies)
Discussion started by: parpaa
3 Replies

5. Shell Programming and Scripting

How to Compare local & remote Files over ssh?

I want to make a script to compare list of files in terms of its size on local & remote server whose names are same & this is required over ssh. How can I accomplish this. Any help would be appreciated. (1 Reply)
Discussion started by: m_raheelahmed
1 Replies

6. Shell Programming and Scripting

FTP files from different directory from remote server to one directory in local

Hi All, I want to search for .log files from folders and sub folders in remote server and FTP them to one particular folder in the local machine. I dont want to copy the entire directory tree structure, just have to take all the .log files from all the folders by doing a recursive search from the... (3 Replies)
Discussion started by: dassv
3 Replies

7. Shell Programming and Scripting

preserving the timestamp of a file when copied from remote server to local server using ftp

Hi, I need to copy few files from remote server to local server. I write a shell script to connect to the remote server using ftp and go to that path. Now i need to copy those files in the remote directory to my local server with the timestamp of all those files shouldnt be changed. ... (5 Replies)
Discussion started by: arunkumarmc
5 Replies

8. UNIX for Dummies Questions & Answers

Copying files from a remote server to local system with cygwin

Hi. I'm sorry if I get on people's nerves asking this, but I don't really understand how to do this and unfortunately don't have the time to work through it step by step in books, etc. At University, we have a unix server that hosts our files. we each have a login and password to access it. I... (3 Replies)
Discussion started by: patwa
3 Replies

9. Shell Programming and Scripting

FTP multiple files from remote server to local server

Hi, I am facing a weired problem in my FTP script. I want to transfer multiple files from remote server to local server everyday, using mget * in my script. I also, want to send an email for successful or failed FTP. My script works for file transfer, but it don't send any mail. There is... (2 Replies)
Discussion started by: berlin_germany
2 Replies

10. Shell Programming and Scripting

How to uncompress zip files in a remote server from a script

Hi UNIX gurus, the scenario is that i have written a script which takes as input a directory structure. And after that a tar is made ,then zipped and FTP it to a server.But how do i uncompress it from my script as FTP doesnot support any uncompress command during FTP session. I have to automate... (2 Replies)
Discussion started by: rahul26
2 Replies
Login or Register to Ask a Question