I want to protect my /tmp directory to prevent the files inside from getting deleted, however "chmod +t /tmp" does not set the sticky bit. Is there alternative way to it on mac os x?
Asked
Active
Viewed 4,872 times
3
-
`/tmp` on OS/X is usually a symlink to `/private/tmp`, so setting permissions on symlink might be the problem here. – Mar 16 '14 at 14:25
-
2there isn't going to be a solution which does not break your OS. You have to choose different directory for permanent file storage. It's called tmp for a reason. – ek9 Mar 16 '14 at 19:17
1 Answers
8
Not with /tmp directory, as it is designed to be wiped upon reboot. Doing this can and will cause problems.
By default, files that aren't accessed in three days are deleted from /tmp
More info: https://superuser.com/questions/187071/in-mac-os-x-how-often-is-tmp-deleted
What you are trying to accomplish is NOT a good idea. Please chose a different folder.