3

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?

ek9
  • 3,392
  • 5
  • 23
  • 34
user3344382
  • 1,941
  • 4
  • 18
  • 17
  • `/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
  • 2
    there 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 Answers1

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.

Community
  • 1
  • 1
ek9
  • 3,392
  • 5
  • 23
  • 34