LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-01-2013, 02:21 AM   #1
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Rep: Reputation: Disabled
millions of mysqld empty files to be deleted with a script


in the process there were created N millions of nearly empty files in a catalog which are found on one partition with mysqld data.
a danger has occured of staying without free inodes.

it is necessary to delete them but not with the simple and slow work of mysqld.

a utility is needed that can do the job and that can be launched with the following way:

gently-recursively-delete /mnt/var-lib-mysql/sorry-me-were-insane
server has the following available:
bash, perl, escript, gcc, g++
 
Old 03-01-2013, 03:11 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
you might want to say please or thank you next time.

find /mnt/var/wherever/ -type f -size 0 -exec rm {} \;

that will delete millions of empty files in a directory. see the find manpage for details.
 
Old 03-01-2013, 03:18 AM   #3
Majed17
Member
 
Registered: Jul 2011
Posts: 102

Original Poster
Rep: Reputation: Disabled
well thanks for the reply, i wish i could try it in practice
 
Old 03-01-2013, 03:27 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
you can, just change the "exec"

find /mnt/var/wherever/ -type f -size 0 -exec echo rm {} \;

this will just print out the command, rather than execute it.

or just run


find /mnt/var/wherever/ -type f -size 0

and that will just print out the filenames
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] I need help with a script to list deleted files with dates JangoFett353 Linux - Newbie 13 03-31-2011 12:19 PM
I cant make my ip address public (ubuntu server 9.10) and mysqld.sock is empty Jamie Kugelmann Linux - Server 11 05-26-2009 07:40 AM
Need Script to own files owned by deleted users KnightHawk Linux - Server 2 03-20-2009 06:48 PM
Need Script to own files owned by deleted users KnightHawk Linux - Server 1 03-20-2009 05:11 PM
Deleted /etc/init.d/mysqld where? ..:eMa:.. Red Hat 3 10-26-2003 03:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration