One problem you might have is that any update to the directory members (e.g. create new file, rename file, delete file etc.) will update te timestamp of the directory. You need to be clear in your design, else it will go wrong. There is no create date attribute. You may have to schedule a daily job to record that yourself. Overall though, do you want to:-
- Copy the directory if it was created on a particular date
- Copy the directory that was modified on a particular date
- Something else perhaps?
The distinction is on the file/directory attributes. You can tell when a file was last accessed (probably not relevant) changed or modified. A change includes created, permissions changed etc. Modified is the content of the file. In the case of a directory it is changes, but not modifications to the files it contains, so the directory is modified if a
chmod is run on a file it contains. If the content of the file is modified, then the directory remains the same.
Which case fits your need? If you need to know what directories are created since your last run, you would probably need to create a history file to tell you what you had and find anything new.
Kind regards,
Robin