谁在创建文件“/private/var/tmp/Untitled-*.uicatalog"? [英] Who's creating the files "/private/var/tmp/Untitled-*.uicatalog"?

查看:40
本文介绍了谁在创建文件“/private/var/tmp/Untitled-*.uicatalog"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调查 TeamCity 构建代理的磁盘空间不足的原因,并在 /private/var/tmp 中发现了 11,000 多个文件,所有文件都以 Untitled-< 命名;random-unique>.uicatalog.

I was investigating why a TeamCity build-agent was running out of disk, and found over 11,000 files in /private/var/tmp, all named along the lines of Untitled-<random-unique>.uicatalog.

每个文件至少为 0.6MB.总磁盘占用空间约为 4GB.

Each file is at least 0.6MB. The total disk footprint is on the order of 4GB.

这些文件的历史可以追溯到几个月前,因此它们在重新启动后幸免于难.

The files dated back several months, so they survived reboots.

谁在创造它们?

推荐答案

谁在创建它们?

Xcode 在编译包含至少一个图像的 xcassets 目录时创建这些.

Who is creating them?

Xcode creates these when compiling an xcassets catalog that has at least one image in it.

AFAIK,是的.

如果您没有很多,您可以使用 rm/private/var/tmp/Untitled-*.uicatalog 删除它们.如果超过 N,则前一个命令中的通配符将扩展为比 bash 允许的更多字符.在这种情况下,使用 ls/private/var/tmp/Untitled-*.uicatalog |并行 rm.

If you don't have many of them, you can delete them with rm /private/var/tmp/Untitled-*.uicatalog. If you have more than N, the wildcard on the previous command will expand to more characters than bash allows. In that case, use ls /private/var/tmp/Untitled-*.uicatalog | parallel rm.

顺便说一句,它们归运行 Xcode 的用户所有,这可能是您.如果没有,请在前面使用 sudo.

BTW, they are owned by the user that run Xcode, which is probably you. If not, use sudo in the preceding.

从 OS X 10.11.3 开始,系统未配置为清理 /private/var/tmp.您可以通过在每天每周每月为 P 运行 来检查这对您是否相同;做 sudo 定期 -${P};完成 并查看文件是否消失.请注意,定期每日脚本(位于 /etc/periodic/daily/110.clean-tmps)只会删除过去 3 天或更长时间创建的内容,并且 ls 不显示创建时间.

As of OS X 10.11.3, the system isn't configured to clean /private/var/tmp. You can check if that's the same for you by running for P in daily weekly monthly; do sudo periodic -${P}; done and seeing if the files go away. Be aware, the periodic daily script (found at /etc/periodic/daily/110.clean-tmps) only deletes things that were created 3 or more days in the past, and ls doesn't show you create-time.

如果要将/private/var/tmp目录添加到periodic清理的目录列表中(参见man period),请执行以下操作:

If you want to add the /private/var/tmp directory to the list of directories cleaned by periodic (see man periodic), do the following:

echo 'daily_clean_tmps_dirs="/tmp /var/tmp"' | sudo tee -a /etc/periodic.conf.local

要查看它是否有效,请每天运行 sudo 定期./private/var/tmp 中 3 天或更长时间前创建的所有内容都将被删除.

To see it work, run sudo periodic daily. Everything in /private/var/tmp that was created 3 or more days ago will be deleted.

这篇关于谁在创建文件“/private/var/tmp/Untitled-*.uicatalog"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆