- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: need to remove files older that 1 day
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2009 07:24 PM
тАО01-20-2009 07:24 PM
Re: need to remove files older that 1 day
That's not what -mtime does. It uses the reference time, not midnight. If you want a date range, you must use -newer.
See these threads where there are:
( -newer temp1.touch -a ! -newer temp2.touch \)
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1254376
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1139965
>when I use +0 I get today's files 1/20
When you use +0, you get all files that have not been modified in the last 24 hours.
>when I use +1 I get nothing and I know there are file date 1/19?
When you use +1, you get all files not modified in the last 48 hours.
If you still have questions, please provide the current date & time and ll(1) on the files:
date; ll *.dbf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-20-2009 11:55 PM
тАО01-20-2009 11:55 PM
Re: need to remove files older that 1 day
are you trying to purge Oracle archived redolog files?
if yes, there are much cleaner ways of managing such files. Read about RMAN and retention options.
if you need any further assistance, please let us know.
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2009 05:56 AM
тАО01-21-2009 05:56 AM
Re: need to remove files older that 1 day
> Dennis: (Assuming UNIX95=FIDDLE_WITH_FIND_TIMES isn't set.)
Agreed; Occam's razor.
> Dennis: match the file basename by using the '-name' option. Why? You think find(1) is faster than the shell? Of course if there are too many files, you are correct.
It isn't about speed, it's about whether or not he wants to descend the directory and process subdirectories, or he wants to confine himself to the top level directory.
> Dennis: Notice that I dropped the '-print' as it is superfluous and out of place. I didn't make that assumption. Perhaps Donald wanted a list? (I assumed that because it was out of place.)
I was wrong on this. I hadn't considered placing the '-print' after an '-exec', though clearly is is viable and would indeed force a listing of what was removed. I can only say that I would have written the '-exec' and its arguments as the last piece.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2009 05:31 AM
тАО01-22-2009 05:31 AM
Re: need to remove files older that 1 day
to find files newer than 20Jan2009 8am and older than 21Jan2009 8am
touch -t YYYYMMddHHmm ./filename
cd /u03/oradata/archive
touch -t 200901200800 ./before
touch -t 200901210800 ./after
find . \( -newer ./before -a ! -newer ./after \) -type f -name "*.dbf" -exec rm -f {} +
rm ./before
rm ./after
And that + is great. I never knew that. And I've been using find for many years. If you have an extremely large number of files to delete (astronomically big that is) I suspect it would complain about too many arguments?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2009 06:35 AM
тАО01-22-2009 06:35 AM
Re: need to remove files older that 1 day
Did you read Dennis' reply, 3rd reply above your reply? He does mention the newer option and 2 URL that have a lot more details on the newer and "older" options.
Donald's original question was "... files older than 1 day", It was changed later on but at this point I am not sure what he is after.not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2009 07:02 AM
тАО01-22-2009 07:02 AM
Re: need to remove files older that 1 day
But at least I provided the syntax of the touch command. And even though the guy didn't ask it, you might be surprised how many times I got answers to questions I didn't ask (yesterday). It is most of the time. And sometimes a side step can provide a faster, simplier safer solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2009 07:34 PM
тАО01-22-2009 07:34 PM
Re: need to remove files older that 1 day
Those were in the links I mentioned.
>If you have an extremely large number of files to delete. I suspect it would complain about too many arguments?
Yes. You could fix this as JRF said.
>But at least I provided the syntax of the touch command.
That was also in the links.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-23-2009 04:08 AM
тАО01-23-2009 04:08 AM
Re: need to remove files older that 1 day
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2009 09:57 AM
тАО01-27-2009 09:57 AM
Re: need to remove files older that 1 day
Since I'll never please everyone anyhow. So I'll do what I want.... which is... in my mind... to attempt to be helpful.
Besides. My normal points for answers is: Unassigned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2009 05:33 AM
тАО01-28-2009 05:33 AM
Re: need to remove files older that 1 day
Confirmed :-).
Dennis>> Assuming UNIX95=FIDDLE_WITH_FIND_TIMES isn't set.
Ok, I give up. I first looked in some man pages, then I googled, searched HP.com (useless), searched the current hpux docs in pdf, even askes Jeeves. No hint on this option. Please explain!
yogeeraj> are you trying to purge Oracle archived redolog files?
That's what I was thinking.
yogeeraj>> if yes, there are much cleaner ways of managing such files. Read about RMAN and retention options.
That might be the best answer yet.
Donald, perhaps CLOSE this topic with a quick summary of what helped you best?
Hein.