Re: temporary files and subsequent cleanup
Re: temporary files and subsequent cleanup
- Subject: Re: temporary files and subsequent cleanup
- From: Brian Stern <email@hidden>
- Date: Fri, 26 Oct 2007 10:11:50 -0400
On Oct 26, 2007, at 7:50 AM, Chris Heimark wrote:
My question is this though. If my application fails, which I am
certain it will never do - hah ;-) - I will have some temp files
left over. Does Tiger+ have a daemon for temporary file removal
that will care of these files from NSTemporaryDirectory() rooted
temporary space here: /private/var/tmp/folders.501/temporaryitems/
and if so, when and how often does it run to take care of this?
There are three scripts
/private/etc/daily
/private/etc/weekly
/private/etc/monthly
that are intended to run periodically. This snippet from daily
cleans up /tmp
if [ -d /tmp ]; then
cd /tmp && {
find -x . -fstype local -type f -atime +3 -ctime +3 -exec rm -f
-- {} \;
find -x -d . -fstype local ! -name . -type d -mtime +1 -exec
rmdir -- {} \;
\
>/dev/null 2>&1; }
fi
It seems to be waiting three days from the last access time to rm the
files.
If the computer is sleeping or turned off, of course, the scripts
won't run.
You can view the log files generated by these scripts in the Console
utility application.
You can execute the scripts yourself by just typing their names in
the Terminal if you like.
--
Brian Stern
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden