|
Compare Last Modified Time across Time Zone
Hi,
I'm new to shell script programming, I only have Java programming background.
I'm writing a shell script to do file synchronization between 2 machines that located at different time zone area. Both machine were set its time zone according to its geographical location (Eg: server is at GMT, and client is at GMT+5). I need to do file synchronization between this 2 machines, taking the latest updated file from server, and scp it to client.
The problem I face is both machines are in different time zone, so that the last modified time doesnt not reflect the actual different.
Eg: for file /tmp/test.txt in both machines
Server: last modified time is Jan 01, 2009 02:00:00 (at GMT 0)
Client: last modified time is Jan 01, 2009 06:00:00 (at GMT +5)
From the surface, it looks like the file in Client is the latest. But when you consider it with time zone, you will find that the file in Server is the latest version.
After manually fine tuned both file with GMT0:
Server: last modified time is Jan 01, 2009 02:00:00 (at GMT 0)
Client: last modified time is Jan 01, 2009 01:00:00 (at GMT 0)
So, anyone help me to solve this issue?
Thank you!
|