I've read that /tmp
will automatically have files deleted that are older than 7 days or upon restart, but I can't seem to find where this is documented. Can anyone point me to a man or web page from Apple?
Asked
Active
Viewed 66 times
0

Chuck
- 1,780
2 Answers
3
There is a little documentation here on the background tasks that do things like clear up the /tmp folder, but it is marked as archived now and Apple don't seem to have released an updated version.
There should be a log at /var/log/daily.log
for the daily script that (amongst other things) clears out the /tmp folder.

Alistair McMillan
- 14,187
1
As @patrix pointed out, in cases like this, the source code is sometimes the best documentation, perhaps especially for interpreted (as opposed to compiled) software, so the documentation for this is currently found in /etc/periodic/daily/110.clean-tmps
and /etc/defaults/periodic.conf
.

Chuck
- 1,780
/tmp
's documentation, although given what that poster said, my source for files being deleted after 7 days appears to be incorrect. – Chuck Jul 09 '14 at 11:05/etc/defaults/periodic.conf
, which is the location of a configuration file (which I did acat
on, just in case), not a documentation file.man periodic
says nothing about/tmp
. Am I missing something that you're seeing? – Chuck Jul 09 '14 at 11:12/etc/periodic/daily/110.clean-tmps
, which, given the config file, ostensibly confirms that cleanup is supposed to happen to/tmp
every 3 days, but it would seem that reading the bash scripts can't be the only place this is documented. – Chuck Jul 09 '14 at 11:27