6

Is it safe to put my temporary manual backups of my website codebase and database into the /tmp folder? I'm running Debian 8. I want to leave them there for a couple days. I am not sure if this directory gets overwritten or emptied on it's own.

Thanks!

13

I would say it is not safe in general. On many systems, /tmp is cleaned on reboot by default. See /etc/default/rcS (TMPTIME defaults to 0),

# delete files in /tmp during boot older than x days.
# '0' means always, -1 or 'infinite' disables the feature
#TMPTIME=0
6

It's a bad idea, for at least three reasons:

  • On many systems, /tmp is automatically emptied on reboot.
  • Additionally, this folder may be mounted as temporary filesystem stored in RAM rather than on disk, meaning that its capacity may be too small to hold your backup files. What you do use up will in such a case take away memory which would better be used for running applications.
  • /tmp most often uses access permissions not normally used for normal directories (sticky bit + readable by all) so you may accidentally make your files available to all users on your system if you don't pay attention.
3

Not safe at all on most systems. /tmp is usually deleted automatically one way or another.

0

On my OS(debian 8.6), /tmp dir is emptied after each system boot.

If you does want somewhere to put backup instead external hard disk, I think /var is a good place.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.