[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: need to compare timestamps
- From: Bob Chiodini <rchiodin bellsouth net>
- To: For users of Fedora Core releases <fedora-list redhat com>
- Subject: Re: need to compare timestamps
- Date: Wed, 06 Apr 2005 12:11:58 -0400
On Wed, 2005-04-06 at 15:47 +0000, rado wrote:
> hi!
>
> 2 machines
> set up ssh passwordless
> need to be in a script
> /tmp/<file> on both machines
>
> I need to compare the timestamps and get the newest
>
> thx
>
> John Rose
>
>
>
John,
filetime1=`stat --format=%Y $FILENAME1`
filetime2=`ssh hostname stat --format=%Y $FILENAME2`
if [ $filetime1 -gt $filetime2 ]
do something if filetime1 > filetime2
fi
--format=%Y gets the last modification time.
Bob...
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]