"#! /bin/sh
ToM=`stat -c=%Y webtogo.cpp | awk -F"=" '{ printf $NF }'`
[ $(( `date +%s` - $ToM )) -gt 1800 ] && echo " File is older than 90 min"
ToM is Time of Modification
Vino"
ToM=`stat -c=%Y webtogo.cpp | awk -F"=" '{ printf $NF }'`
[ $(( `date +%s` - $ToM )) -gt 1800 ] && echo " File is older than 90 min"
ToM is Time of Modification
Vino"
Nice...
Another spin on this is that age of file in minutes is:
#!/bin/bash
for fil in $*
do
eval expr "\( $(date +%s) - $(stat -c=%Y $fil | sed 's/=//') \) / 60"
done
Cheers,
No comments:
Post a Comment