- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Quikly remove large no 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
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-12-2001 01:59 AM
тАО09-12-2001 01:59 AM
Quikly remove large no of files
A large number of files (> 100,000 files) is in /backup directory. rm -fR /backup takes more than one day to clear all files. Can I use any other command to remove these files within a short time.
Thanks
Senthil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2001 02:09 AM
тАО09-12-2001 02:09 AM
Re: Quikly remove large no of files
If /backup is a separate filesystem, I would recommend just recreateing the fs, i.e.:
umount /backup newfs -F vxfs
mount /backup
Hope this helps.
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2001 02:15 AM
тАО09-12-2001 02:15 AM
Re: Quikly remove large no of files
This is one of the directory in the file system. It is not possible to recreate the file system. Any other methods?
Thanks
Senthil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2001 02:22 AM
тАО09-12-2001 02:22 AM
Re: Quikly remove large no of files
I guess there is no way out, if you can not recreate the filesystem.
If you need the directory, you could try to
mv /backup /backup_old
mkdir /backup
and than do a "rm -r /backup_old" in the background and let it run....
If you need this frequently, I would recommend to mount a seperate filesystem at /backup.
Volker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2001 02:37 AM
тАО09-12-2001 02:37 AM
Re: Quikly remove large no of files
If your files names can be grouped then write serveral small scrips each one to remove a group and then cron these scripts to run one min after each other.
i.e.
-----------cut here-------------
rm a*
----------cut here--------------
This will spread the rm command accross the system - but be aware of load implications.
hth
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2001 04:33 AM
тАО09-12-2001 04:33 AM
Re: Quikly remove large no of files
I guess the size of that directory itself (seen with "ls -ld")
is pretty big. And since UN*X (all UN*Xes) *always*
reads and writes directories at once, the whole dir will
be written every time a single file is deleted...
So, except for "mkfs"ing a new filesystem, you will have
to wait :-(
But then, immediately "rmdir" the directory, and "mkdir"
at new - the only way to shrink it.
HTH,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2001 04:37 AM
тАО09-12-2001 04:37 AM
Re: Quikly remove large no of files
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2001 06:41 AM
тАО09-13-2001 06:41 AM
Re: Quikly remove large no of files
Maybe it is an improvement, first to copy all other directories to a different file system, then re-create the original file system and copy back. You need the original file system unused during the operation.
Klaus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2001 07:50 AM
тАО09-13-2001 07:50 AM
Re: Quikly remove large no of files
dir_to_delete=/bigdir
ll $dir_to_delete | awk '{ print $9 }' > $dir_to_delete/list_of_files.txt
for files in `cat $dir_to_delete/list_of_files.txt`
do
> $files
rm $files
done
exit 0
Something like that ??
Or what about the possibility of removeing the entry out of the superblock that refers to those inodes? (YUCK) but might be an option?
Just some thoughts.
Good Luck
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2001 07:17 PM
тАО09-13-2001 07:17 PM
Re: Quikly remove large no of files
2. make a new file system on it
3. mount /backup on the new logical volume
repeat steps 2 and 3 as needed
to get comfortable with this will take you a week, after that you can do it in 5 minutes