Solved

Comparing file date/time stamp between 2 hosts.

Posted on 2000-03-17
7
424 Views
Last Modified: 2010-08-05
Any suggestions for comparing file date/time stamp between 2 hosts?  I have to compare like named files (and dirs.) between 2 hosts, and then overlay the older file with a newer file.  I want to avoid ftp'ing or remote copying any unnecessary files between the hosts, and cannot think of how to accomplish this task without doing so.  
Thanks.
0
Comment
Question by:kfleary
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2628961
Do you have rdist? That's exactly the what rdist is for.
0
 

Author Comment

by:kfleary
ID: 2629055
The problem is that I cannot identify the files on one server as the "master" files?  I literally have to compare the two files for the most current date/time stamp.  Then the newest file will be copied over the the server with the old file.
0
 
LVL 3

Expert Comment

by:kinsey
ID: 2629463
Have you tried using CPIO either through a rsh pipe or a mounted filesystem?
i.e.

cd /data
find . -depth -print|cpio -ov|rsh otherhost "(cd /data;cpio -ivd)"

By default cpio does not copy older files top on newer ones.

Harold
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 21

Expert Comment

by:tfewster
ID: 2629467
Have you considered NFS mounting filesystems between the 2 hosts so you only have a single copy of the file(s)?

Solaris has a command "filesync" that will do what you want, based on rules you define (e.g. what to do if both files have changed from the "baseline"); I'll check to see whether this is available for other Unixes.
0
 

Author Comment

by:kfleary
ID: 2630303
I need to have the files synced on both servers, and one server cannot act as the "master".
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2630639
Okay, that would probably eliminate rdsit from consideration. I can see a couple of other ways to solve the problem. To determine which would be the most appropriate and most efficient I need to know a bit more about the environment. What rights do you have on the remote systems, ordinary login, rsh/rexec? Is installation of safe and well behaved PD tools on the local and remote systems possible?
0
 
LVL 2

Accepted Solution

by:
mapc earned 60 total points
ID: 2631865
Since the obvious solution is writing a script that does it, and I assume that it's not what you're asking for,
I shall recommend using rsync.
This tool does exactly what you need, it allows to keep files in sync, it can use rsh or ssh, or any other remote-shell, it can use compression, it can check timestamp and md5sum and many many more features. Find it at:
http://rsync.samba.org/
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question