- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to Delete files older than 6 hours
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
Forums
Discussions
Discussions
Discussions
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
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
04-17-2006 12:28 AM
04-17-2006 12:28 AM
How to Delete files older than 6 hours
Thanks in Advance
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2006 12:31 AM
04-17-2006 12:31 AM
Re: How to Delete files older than 6 hours
find /start_dir ! -newer ref_file -exec rm {} \;
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2006 12:39 AM
04-17-2006 12:39 AM
Re: How to Delete files older than 6 hours
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2006 12:54 AM
04-17-2006 12:54 AM
Re: How to Delete files older than 6 hours
You can do this to create a reference point that is 6-hours ago:
# t=`perl -e 'use POSIX;$t=time-(6*60*60);print(strftime "%m%d%H%M",localtime($t))'`
# touch -amt ${t} /tmp/myref
# find /path -xdef -type f ! -newer /tmp/myref | xargs rm
This will find all files in the /path you specify; not cross mountpoints (-xdev) and remove all files that are older (i.e not newer) than the reference file's modification time in epoch seconds. Note that (6*60*60) is the 6-hour time you requested.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2006 02:34 AM
04-17-2006 02:34 AM
Re: How to Delete files older than 6 hours
Normal "find" command has a granularity of days.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2006 02:36 AM
04-17-2006 02:36 AM
Re: How to Delete files older than 6 hours
http://hpux.connect.org.uk/hppd/hpux/Gnu/findutils-4.2.27/
Enjoy!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2006 03:15 AM
04-17-2006 03:15 AM
Re: How to Delete files older than 6 hours
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2006 05:10 AM
04-17-2006 05:10 AM
Re: How to Delete files older than 6 hours
touch a newfile, then use find with != newer , then remove
Chan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2006 05:14 AM
04-17-2006 05:14 AM
Re: How to Delete files older than 6 hours
Things like /stand/vmunix are greater than 6 hours old. If you start throwing around "."s and "*"s then you're next post will be on how to re-ignite the system.
I speak from experience.