Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-04-2004, 10:26 PM   #1
LQ Newbie
Registered: Feb 2004
Posts: 1

Rep: Reputation: 0
how to find directories created in the last 30 mins?

I think this is supposed to be an easy one but I can't quite figure it out:

I need to find, under the current directory, all the subdirectories that were _created_ in the last 30 minutes. I've tried using the find command but the find command does not seem to have an option for directory creation timestamp but things like mtime, atime, ctime etc. I don't want to include subdirectories that were created beyond the last 30 mins and were modified in the last 30 mins, only those _created_ during the last 30 mins.

Can someone shed some lights on this?


Last edited by a128; 02-04-2004 at 10:29 PM.
Old 02-04-2004, 11:06 PM   #2
Senior Member
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
I don't think it can be done with the directories attributes alone. As you stated files and directories only have three time attributes:
st_atime - time of last access
st_mtime - time of last modification
st_ctime - time of last change

All these fields may change after creating the directory.

I'd probably suggest running a process out of cron every 30 minutes or creating a daemon process. Either way you will have to cache up or save the directories that exist already and check for new ones against the list.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ProFTPD: Set umask so that directories are created with 'sticky bit' on. dutch2005 Linux - Software 1 09-06-2005 05:06 AM
Using FIND to locate files created between certain dates billybobjoe1984 Programming 6 07-23-2005 06:07 PM
how to find directories with a space in it :P ToBe Linux - General 4 01-05-2005 01:10 PM
How do I find out when a directory was created? gumpish Linux - Newbie 1 09-29-2004 08:12 PM
how are home directories created waynevnc Debian 3 07-02-2004 08:39 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:40 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration