- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Removing HUGE amt 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
11-19-2004 04:23 AM
11-19-2004 04:23 AM
Basically, files .xml that were not accepted from another system was placed in this /bad directory.
We were under the impression that this directory was purged. But, we are wrong. Now it is so huge that wc -l, will not return anything. We need to delete files older then 2 months. But, our find command hung as well.
Any ideas?
We wanted to keep a log of what was deleted as well.
This is our command..
We first touched a file with a date of 2 months ago.
find . -type f -newer ../testfile -exec rm -f {} ";"
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2004 04:27 AM
11-19-2004 04:27 AM
Re: Removing HUGE amt of files
I think the use of xargs with your find will solve your problem
Good luck
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2004 04:28 AM
11-19-2004 04:28 AM
Re: Removing HUGE amt of files
Secondly, are you sure the command hung, or is it just gradually working it's way through all the files?
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2004 04:46 AM
11-19-2004 04:46 AM
Solutionwe still use the -exec rm to remoce them but we use xargs -l10 to log them 1st into a log file (prior to deletion).
the "-l10" will reduce the number of processes generated.
##########################################
ind_PRT () {
DIR=
if [ -d $DIR ]
then
echo $DIR
echo "================================================="
find $DIR \( -name "*.[SP]RT" -o -name "*.PRT.lan" \) \
-mtime $DAYS | xargs -l10 ll echo "deletion..."
find $DIR \( -name "*.[SP]RT" -o -name "*.PRT.lan" \) \
-mtime $DAYS -exec rm {} \;
else
echo "
echo "================================================="
fi
}
#####################################
Regards
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2004 04:50 AM
11-19-2004 04:50 AM
Re: Removing HUGE amt of files
This will call the rm command as few times as possible (with each time as many as possible arguments).
On the other hand, really many small files slow down the removal of the files from the filesystem.
JP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2005 01:02 AM
02-23-2005 01:02 AM