find files older than 10 min - script/cmd problem

Hi guys,

Working on a 8.1-PRERELEASE and having problems with 1 find cmd:
Code:
find /path/ro/folder -type d -depth 1 -mmin -10

The idea of the script is that if there are files older that 10 min, a rsync is started, else the script just exists. It will be run from crontab every 10 min.

The problem is that if I create a file in that dir, the find cmd will not discover it. I;ve been hitting my head against the wall since yesterday and I also tried -atime, -mtime, with several combinations of days, hours, minutes but couldn't find a proper option to use.

Can anyone lend a hand here ?
 
vermaden said:
The -type d switch means directories while -type f means files ...

[cmd=""]% find . -type f -mtime +10m[/cmd]

Wops, my bad, I'm looking for dir's :).
About the cmd ("+10"), it returns dir's that are more than 10 min old (AFAIK, "+" means more than, and "-" means less than) and dir's older than 10 min is not what I'm looking for because there already are folder older than several days there.

The idea is to run the script every 10 min (maybe even more) and if there are new dirs, rsync them (but do not touch the already existing and old ones (more than 1 month old).
 
da1 said:
The idea is to run the script every 10 min (maybe even more) and if there are new dirs, rsync them (but do not touch the already existing and old ones (more than 1 month old).
So You need -mtime -10m then and -type d also.

BTW, why are You still using 8.1-PRERELEASE?
 
vermaden said:
BTW, why are You still using 8.1-PRERELEASE?

Not my choice (company) ... cmd works ! :).

The bug was the 2 legged thing between the monitor and the chair :D. Was using a wrong check cmd ... $#iT
 
vermaden said:
I assume that they did not heard about backups neither, didnt they? ;p

AFAIK, there is some sort of backup system in place but so far I didn't really check for it or how/where it is configured.
 
Back
Top