- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Find inactive files and remove them
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
тАО09-06-2010 10:09 AM
тАО09-06-2010 10:09 AM
Find inactive files and remove them
I think I saw a 'find' command which uses 'fuser' and 'rm' subcommands in -exec parameters to remove all inactive (not opened by other processes) files. Does anybody remember that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 10:40 AM
тАО09-06-2010 10:40 AM
Re: Find inactive files and remove them
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 10:48 AM
тАО09-06-2010 10:48 AM
Re: Find inactive files and remove them
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 11:09 AM
тАО09-06-2010 11:09 AM
Re: Find inactive files and remove them
What if an application is running, but newly opens a file for each access?
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 11:11 AM
тАО09-06-2010 11:11 AM
Re: Find inactive files and remove them
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 12:06 PM
тАО09-06-2010 12:06 PM
Re: Find inactive files and remove them
I can't fathom why you want to remove all files that are "not opened by other processes" --- test server or not.
If your objective is to remove all files except in-use executables and shared libraries, a simple 'rm' should do. Executables and shared libraries that are in-use will be fail to be removed with a "text busy" error.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 12:44 PM
тАО09-06-2010 12:44 PM
Re: Find inactive files and remove them
If you are trying to regain some disk space, that is not the way to do it. You would first look at your filesystems and determine if any are more than 75% full. Then analyze the directories in these filesystems to determine if there are temporary files that can be removed. Then use swlist to look at the installed applications and subsystems to see if there are some that you do not plan to use. Again, do not swremove a product until you know what it does and whether other products depend on this fileset.
If the above list looks complicated and time consuming, you'd be correct. Adding more disks, or replacing small disks with larger disks is much simpler and you won't risk breaking the operating system.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-06-2010 11:46 PM
тАО09-06-2010 11:46 PM
Re: Find inactive files and remove them
I have many subdirectories with Oracle datafiles. All datafiles that are necessary for active instances are active (fuser returns processes). But many are just dumpfiles remaining from old instances partly removed (fuser returns no data). I just need a quick way to tidy it up on regular basis. The subdirectories may contain both active and inactive way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2010 03:57 AM
тАО09-07-2010 03:57 AM
Re: Find inactive files and remove them
> All datafiles that are necessary for active instances are active (fuser returns processes). But many are just dumpfiles remaining from old instances partly removed (fuser returns no data).
You could use 'find -f' to collect the names of all files ("active" or not) into a file. Then, read the file of file names and apply an 'fuser' command to each file name:
# PIDS=$(fuser ${FILE} 2>/dev/null)
If the PIDS variable is empty, no processes are associated with the file, so remove it.
Regards!
...JRF...