As i have a serous sever performance warning with installing drupal-commons (this is a installation-profile) i now want to reduce the server load. Why - i get a message when trying to install drupal commons: Too-many-files-open it says! Well Drupal & modules (ab)uses too many files! 50,000 maximum files and maybe 5000 directories is their goal and that si what they only backup so its in So my question: How can i get rid of all those silly translation files or whatever for tiny miny parts of info and unnecesary subdivisions; How i can get rid of them!
在安装drupal-commons(这是一个安装配置文件)时,我有一个严重的性能警告,现在我想减少服务器负载。为什么——我在尝试安装drupal commons时收到一条消息:太多的文件-打开它!好的Drupal和模块(ab)使用了太多的文件!5万个最大文件,也许5000个目录是他们的目标,如果他们只备份那么我的问题是:我怎么才能摆脱那些愚蠢的翻译文件或者其他的信息和不必要的细分;我怎么能摆脱它们!
Background: I would expect that file_exists() during the installation(or bootstrap-cycle) is the most expensive built-in PHP function measured as total time spent calling the function for all invocations in a single request.
背景:我希望在安装过程中(或bootstrap-cycle)中file_exists()是最昂贵的内置PHP函数,它是在单个请求中调用所有调用的函数的总时间。
Well now i try to get rid of all the overhead (especially of the translation-files that are so called - po-files) - and unnecessary files that are contained in the drupal-commons 6.x-2.3 in order to get it runnning on my server.
现在我试着去掉所有开销(尤其是所谓的翻译文件——po-files)和drupal-commons 6.x-2.3中包含的不必要的文件,以便在我的服务器上运行。
i want to get rid all those silly translation files or whatever for tiny miny parts of info and unnecesary subdivisions;
我想删除所有那些愚蠢的翻译文件或者任何信息的微小部分和不必要的细分;
How to search for all those .po-files recursivly - with GREP i guess .. Note: i do not now where they are!
如何递归地搜索所有这些.po-files——我猜是使用GREP…注意:我现在不知道他们在哪里!
linux-vi17:/home/martin/web_technik/drupal/commons_3_jan_12/commons-6.x-2.3/commons-6.x-2.3 # lsCHANGELOG.txt
._.htaccess install.php modules themes
._CHANGELOG.txt ._includes INSTALL.txt ._profiles ._update.php
COMMONS_RELEASE_NOTES.txt includes ._INSTALL.txt profiles update.php
._COMMONS_RELEASE_NOTES.txt ._index.php LICENSE.txt ._robots.txt UPGRADE.txt
COPYRIGHT.txt index.php ._LICENSE.txt robots.txt ._UPGRADE.txt
._COPYRIGHT.txt INSTALL.mysql.txt MAINTAINERS.txt ._scripts ._xmlrpc.php
._cron.php ._INSTALL.mysql.txt ._MAINTAINERS.txt scripts xmlrpc.php
cron.php INSTALL.pgsql.txt ._misc ._sites
.directory ._INSTALL.pgsql.txt misc sites
.htaccess ._install.php ._modules ._themes
linux-vi17:/home/martin/web_technik/drupal/commons_3_jan_12/commons-6.x-2.3/commons-6.x-2.3 # grep .po
Any way i want to remove all .po files with one bash command - is this possible
任何我想用一个bash命令删除所有.po文件的方法-这可能吗
but wait: first of all - i want to find out all the files - and the ni want to list it: - since i then know what i rease (/or remove)
但是等等:首先——我想找出所有的文件——ni想要列出它:——因为我知道我要做什么(/或删除)
Well - all language translations in Drupal are named with .po -
Drupal中的所有语言翻译都用.po -命名
how to find them with GREP? How to list them - and subsequently - how to erase them!?
如何找到他们与GREP?如何列出它们——以及随后如何删除它们!
update: i did the search with
更新:我搜索了
find -type f -name "*.po"
. well i found approx 930 files.
。我找到了大约930个文件。
afterwards i did remove all them with
后来我确实把它们都拿走了
6.x-2.3 # find -type f -name "*.po" -exec rm -f {} \;
a final serach with that code
最后一个与该代码的serach。
find -type f -name "*.po"
gave no results back so every po-file was erased!
没有返回结果,所以每个po文件都被删除!
manym many thanks for the hints.
谢谢你的暗示。
greetings zero
问候零
2 个解决方案
#1
2
If you want to find all files named *.po
in a directory named /some/directory
, you can use find
:
如果您想查找所有命名为*的文件。po在一个名为/some/directory的目录中,您可以使用find:
find /some/directory -type f -name "*.po"
If you want to delete them all in a row (you do have backups, don't you?), then append an action to this command:
如果你想把它们全部删除(你有备份,不是吗?)
find /some/directory -type f -name "*.po" -exec rm -f {} \;
Replace /some/directory
with the appropriate value and you should be set.
用适当的值替换/some/目录,应该设置您的值。
#2
1
The issue with "too many open files" isn't normally because there are too many files in the filesystem, but because there is a limitation to the amount of files an application or user can have open at one time. This issue has been covered on drupal forums, for example, see this thread to solve it more permanently/nicely:
“打开的文件太多”的问题通常不是因为文件系统中文件太多,而是因为应用程序或用户一次可以打开的文件数量有限。这个问题已经在drupal论坛上得到了讨论,例如,可以看到这个线程更永久地解决这个问题:
http://drupal.org/node/474152
A few more links about open files:
http://www.cyberciti.biz/tips/linux-procfs-file-descriptors.html
http://blog.thecodingmachine.com/content/solving-too-many-open-files-exception-red5-or-any-other-application
还有一些关于打开文件的链接:http://www.cyberciti.biz/tips/linux-procfs- files- descriptors.html http://blog.thecodingmachine.com/content/solving-too- open- files-excepes-red5 -or- others -application
#1
2
If you want to find all files named *.po
in a directory named /some/directory
, you can use find
:
如果您想查找所有命名为*的文件。po在一个名为/some/directory的目录中,您可以使用find:
find /some/directory -type f -name "*.po"
If you want to delete them all in a row (you do have backups, don't you?), then append an action to this command:
如果你想把它们全部删除(你有备份,不是吗?)
find /some/directory -type f -name "*.po" -exec rm -f {} \;
Replace /some/directory
with the appropriate value and you should be set.
用适当的值替换/some/目录,应该设置您的值。
#2
1
The issue with "too many open files" isn't normally because there are too many files in the filesystem, but because there is a limitation to the amount of files an application or user can have open at one time. This issue has been covered on drupal forums, for example, see this thread to solve it more permanently/nicely:
“打开的文件太多”的问题通常不是因为文件系统中文件太多,而是因为应用程序或用户一次可以打开的文件数量有限。这个问题已经在drupal论坛上得到了讨论,例如,可以看到这个线程更永久地解决这个问题:
http://drupal.org/node/474152
A few more links about open files:
http://www.cyberciti.biz/tips/linux-procfs-file-descriptors.html
http://blog.thecodingmachine.com/content/solving-too-many-open-files-exception-red5-or-any-other-application
还有一些关于打开文件的链接:http://www.cyberciti.biz/tips/linux-procfs- files- descriptors.html http://blog.thecodingmachine.com/content/solving-too- open- files-excepes-red5 -or- others -application