Re: temporary files and subsequent cleanup
Re: temporary files and subsequent cleanup
- Subject: Re: temporary files and subsequent cleanup
- From: Alastair Houghton <email@hidden>
- Date: Fri, 26 Oct 2007 16:24:10 +0100
On 26 Oct 2007, at 16:06, Chris Heimark wrote:
I knew of these jobs. And upon (finally) examining them for the
first time, I see that they reach into /tmp and other directory
structures.
Yes.
I tried to trace how /tmp --> private/tmp ultimately points into /
private/var/tmp/folders.501/temporaryitems/ and I gave up... Maybe
that is why I stopped programming in Unix years ago...
It doesn't. So you wouldn't have had much luck. /tmp points at /
private/tmp. It's the UNIX-style shared tmp folder, so if you create
things in there you have to avoid conflicts (and security holes)
caused by other users' access to that directory. If you look in /
private/tmp, I suspect you'll find some numbered folders with
peoples' UIDs as their names, as that's quite a common way to address
that problem.
But I still wonder why, after running "sudo /private/etc/
daily" (and later "sudo /private/etc/weekly") I still have files/
directories older than 3 days present.
I don't think they actually clear out /var/tmp. At least, on Tiger,
it looks like /var/tmp is only cleared out when you restart the
machine (from the /etc/rc script), and even then it only clears out /
var/tmp/folders.*, so things in /var/tmp will remain indefinitely,
which explains why I have files dated 2006 in that folder on my Mac
Pro. Arguably this is a bug.
I think the /var/tmp folder, BTW, is the one that you get if you ask
various Carbon/Cocoa APIs for a temporary folder.
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.
It looked like launchd was going to start doing this itself, so I
don't know (yet) whether this is necessary for Leopard.
Isn't it launchd that makes the daily/weekly/monthly jobs run? Or
is it entries in crontab that lead to their execution?
On Panther and earlier, it was crontab that drove it. On Tiger and
later, it is done by launchd. Unless, of course, you install
anacron, in which case (at least for the packages I mentioned),
anacron takes over the periodic job execution.
I'm hoping, though I haven't checked, that Leopard's launchd is now
capable of subsuming the functionality of anacron, as that behaviour
makes the most sense for most desktop and laptop machines.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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