Re: need to compare timestamps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > 
> > 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...
> 
thx, Bob, lemme try

thx
jr



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux