Linux系统下/tmp目录文件重启后自动删除

经常会把临时性的log或抓包等文件放在/tmp目录下,重启后发现文件都丢失了。查下资料发现,可以通过设置解决这个问题。
在/etc/default/目录下有个rcS文件,文件内容如下:
#
# /etc/default/rcS
#
# Default settings for the scripts in /etc/rcS.d/
#
# For information about these variables see the rcS(5) manual page.
#
# This file belongs to the "initscripts" package.


TMPTIME=0
SULOGIN=no
DELAYLOGIN=no
UTC=yes
VERBOSE=no
FSCKFIX=no
RAMRUN=no
RAMLOCK=no

红色字体TMPTIME=0。值为0表示重启后删除文件,值为-1就不会自动删除文件,职位正整数表示/tmp目录下文件保留时间。

http://blog.chinaunix.net/uid-26212859-id-3567875.html

原文地址:https://www.cnblogs.com/7qin/p/13510342.html