Using the /tmp folder for backups, recommended?

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

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.

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

Tags:

Backup

Debian

Tmp