From the stat(2) manual:
struct stat
{
...
time_t st_atime; /* time of last access */
time_t st_mtime; /* time of last modification */
time_t st_ctime; /* time of last change */
};
Traditionally, st_ctime is changed by writing or by set
ting inode information (i.e., owner, group, link count,
mode, etc.).
The ctime field is about as close to creation time as you can get. In
earlier Unixen I worked on, ctime used to hold the file creation
time. Now it can change after creation also.
Also, I'd slightly change the find command to:
find /path/to/dir -type f -ctime +3 | xargs rm
+3 will find all files whose ctime field is 3 days or more old.
Regards,
-- Raju
>>>>> "Binand" == Binand Raj S <[EMAIL PROTECTED]> writes:
Binand> Anilkumar forced the electrons to say:
>> I wish to delete all files in a directory which are created
>> before 3 days using crontab. How to do this.
Binand> Linux (for that matter, I think all Unixen) do not keep
Binand> track of file creation time. What you want is file
Binand> modification time, or mtime. Put this command in your
Binand> crontab:
Binand> find /path/to/dir -mtime 3 | xargs rm
Binand> Warning: test it out! change the rm to echo or something
Binand> and verify that it is indeed finding the right files.
Binand> Binand
--
Raju Mathur [EMAIL PROTECTED] http://kandalaya.org/
----------------------------------------------
LIH is all for free speech. But it was created
for a purpose. Violations of the rules of
this list will result in stern action.