How can I tell if a file is older than 30 minutes from /bin/sh?

linux, sh, unix

Solution

Here's one way using `find`.

if test "`find file -mmin +30`"

The `find` command must be quoted in case the file in question contains spaces or special characters.

Problem

How do I write a script to determine if a file is older than 30 minutes in /bin/sh? Unfortunately does not the `stat` command exist in the system. It is an old Unix system, http://en.wikipedia.org/wiki/Interactive_Unix Perl is unfortunately not installed on the system and the customer does not want to install it, and nothing else either.

Original source