Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Who's creating the files "/private/var/tmp/Untitled-*.uicatalog"?

Tags:

xcode7

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.

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.

Who is creating them?

like image 286
mr. fixit Avatar asked Mar 04 '16 10:03

mr. fixit


1 Answers

Who is creating them?

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

Can I delete them?

AFAIK, yes.

How do I delete them?

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.

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

How can I keep them from accumulating in the future?

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.

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

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

like image 153
mr. fixit Avatar answered Nov 09 '22 19:11

mr. fixit