We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

find files more than 30 minutes old

daveyu
daveyu asked
on
Medium Priority
1,007 Views
Last Modified: 2013-12-27
Hi,

How can I use the find command to find files that are more than 30 minutes old?.
Comment
Watch Question

the find mtime, ctime and atime options only take integers so you can only get a day granularity.  Try a script using perl stat function something like

($filename) = @ARGV;
die "I need a file name.\n" unless $filename;
   ($atime,$mtime,$ctime) = stat($filename);
   print "atime = $atime\n";
   print "mtime = $mtime\n";
   print "ctime = $ctime\n";
exit;
CERTIFIED EXPERT
Commented:
Download the GUN find (findutils), for you version of OS from:
    http://sunfreeware.com/

then you can use:

/usr/local/bin/find /mydir -type f -cmin +30 -print

With the native Solaris "find", the best you can do is "touch & find"

you need to do something like:

create stamp file , then
touch -t [YY]MMDDhhmm stampfile

write the current date ,
and time older than the current time by 30 min.

touch -t 200307120000 stampfile

find /yourdir -type f ! -newer stampfile -print

also see http:Q_20670315.html 

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.