Any alternative for mmin or cmin parameter

Hi,

I need to write a shell script where I need to check whether log file is generated in last 1 hour or not. But I am getting below error in using mmin or cmin parameter with find command:

find: bad option -mmin
find: bad option -cmin

So my concern is that any alternative for mmin option is there which I can use?

Any help will be greatly appereciated.

Thanks in advance.

What operating system are you using?

What are the complete find commands that are generating those diagnostics?

I will take care for using CODE tags in future.

The full find command I tried is as below:

CODE:

find "PATH of the file" -name '*.log' -mmin +60 -exec ls -lrt {} \;

We'll try again. Are you on Linux? No? It does not look like it. Then what UNIX?

This is solaris: below version-

SunOS hostname 5.10 Generic_144488-12 sun4u sparc SUNW,SPARC-Enterprise

Solaris 5.10's find doesn't have fine-grained timestamp checking like GNU's find utility. A common way for dealing with this on Solaris systems is to create a file with a timestamp matching the start point you're interested in using:

touch -t YYYYMMDDhhmm /tmp/start_time

and then using:

/usr/xpg4/bin/find "file hierarchies to be searched..." -name '*.log' -newer /tmp/start_time -exec ls -lrt {} +

(Note that -exec ls -lrt {} \; executes ls once for each file selected, so the output probably will not be in time sorted order. With -exec ls -lrt {} + , ls will be executed once for a group of files, but there is still no guarantee that all of the selected files will be sorted by timestamp. But, if the number of files you're selecting is relatively small [which I would expect to be true when selecting files no more than an hour old], the selected files will probably all be listed in reverse timestamp order.)