find and delete old files
Hi
I would like to delete some old redolog file in oracle directory and try this command: Code:
find /oracle/IDS/oraarch -ctime +1 -print I tried as well mtime and atime. Unfortunately I get listed only 3 files (first 3 files), but the list should be much longer. I though maybe system time is wrong, but command 'date' gives me correct time. When I execute 'ls -la' I see whole list of files with dates. I also tried to use 'stat <FILE>' to check some single files. When I use: Code:
find /oracle/IDS/oraarch -ctime 1 -print has anybody explanation for this strange behavior? regards Rafal |
The time options of find are atime, ctime and mtime. These refer to, in order, the time the file was last accessed, the time the file's status was last changed, and the time the files data was last modified.
The option that most closely relates to the output of ls is mtime, so change your find statement to use that instead of ctime. |
Quote:
Thanks for the answer, but as I said "I tried as well mtime and atime." its all the same, to I really do not know what is the issue here. Apparently something with "+" sign and the way how its interpreted regards Rafal |
Sorry for not reading properly. The difference between 1 and +1 is "exactly 1" compared to "more than 1" days ago. If you specify the "+" in your find, then it means "more than that many days" ago. If you leave it out, it means "exactly that many days ago".
An example from my server, using 32 instead of 1:- Code:
[root@eddie WORK]# find . -mtime 32 -exec ls -ld {} \; Plus, I still think you should use mtime instead of ctime ;) |
Quote:
Thanks a lot for your help I don't understand why it didn't worked before, but the main thing is : it works now regards Rafal |
All times are GMT -5. The time now is 06:25 AM. |