ksh - AIX: get epoch time/age for a file?

Hi,

(AIX 5.1)
Is there any way to find the epoch timestamp for a file without having to use fancy perl (or similar) scripts? If anyone knows of a way to do this using just ksh commands it would be appreciated.
(It also appears I don't have the stat command available).

Alternatively is there a way to find the age of a file (in seconds or minutes) before $(date) i.e. now.

My aim is to write a script to run as a cron job that will look at the timestamp of some log files we keep. If the timestamp is older than 60 minutes, I want it to echo a message to another file.

Thanks in advance.:b:

Not that I know. If you don't want to do arithmetics with shell or perl, maybe use "cksum" on those logs and write it to some file and compare it every 60 minutes later.

I know recent versions of AIX have ksh93 installed. Not sure about AIX 5.1 however. If ksh93 is available to you you can easily convert file atime, ctime, etc to seconds from Epoch as show in the following example. After that date arithmetic is easy.

#!/usr/bin/ksh93
#
# list all files in current directory that are more that 3 days old
#

TMP=file.$$
MIN=$(printf '%(%s)T' "3 days ago")

ls -l > $TMP

while read j1 j2 j3 j4 j5 d1 d2 d3 filename
do
    AGE=$(printf '%(%s)T' "$d1 $d2 $d3")
    # print $AGE
    if (( $AGE < $MIN ))
    then
       print "$d1 $d2 $d3 $filename"
    fi
done < $TMP

rm $TMP

Cheers guys but I've actualy managed to botch my way through this using the find command. Something simple like this is doing everything I need

#!/usr/bin/ksh

LOGDIR=/directory/logs/
DATE=$(date +%Y%m%d)
LOGFILE=mylog.${DATE}

if [[ -z $(find $LOGDIR -name $LOGFILE -mmin -60) ]]
then echo "$LOGFILE has not been modified for 60 minutes" > /tmp/output
else echo "$LOGFILE has normal activity" > /tmp/output
fi

Maybe it's not too pretty but it seems to work - and no need for perl or shell arithmetic.