- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: bulk delete of files
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
07-06-2007 06:18 AM
07-06-2007 06:18 AM
bulk delete of files
It is taking too much of time to process million entries. Is there any way i can delete files in bulk from the system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2007 07:04 AM
07-06-2007 07:04 AM
Re: bulk delete of files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2007 05:48 PM
07-06-2007 05:48 PM
Re: bulk delete of files
As Clay said, the most you could do is use xargs to cut down the cost of invoking rm 1 million times.
Are these files scattered all over the system, or in a very few directories?
If the former, you may want to try doing separate xargs/rms for separate directories.
I'm not sure if sorting the files will help or hurt?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2007 02:43 AM
07-07-2007 02:43 AM
Re: bulk delete of files
Any concurrent access to the same file system where you are deleting files will slow things down. Directory locking is managed with shared read and exclusive write locks. Thus, two processes can be reading the directory at the same time, however, if a process wants to update the directory, it will have to wait for the reader processes to exit to obtain an exclusive write lock, which will cause other writers and readers to block.
With early JFS (3.1) using a full path to access files was very inefficient. Later JFS versions don't have this problem and have other improvements in directory management.
If you could get these incoming files organized into subdirectories then it would be efficient to do parallel processing.
Ken Johnson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2007 02:44 AM
07-07-2007 02:44 AM
Re: bulk delete of files
a) retain what you need daily and blow away the whole filesystem weekly?
b) are you using a shell script to read and remove? That will fork a process for each delete, unless you manage to aggregate arguments (with xargs or otherwise). Try a program to read the file and call teh delete service instead of the delete tool (rm).
For example the following two word perl program might just be faster than your script:
$ perl -ne 'chomp; unlink' list-of-files
Hope this helps some,
Hein van den Heuvel (at gmail dot com)
HvdH Performance Consulting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2007 10:05 PM
07-08-2007 10:05 PM
Re: bulk delete of files
if your filenames do not contain a space or TAG chatacter, try a simple
xargs rm -f
mfG Peter