如何在Linux的/tmp目录中永久存储数据 [英] How to store data permanently in /tmp directory in linux

查看:88
本文介绍了如何在Linux的/tmp目录中永久存储数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以在Linux tmp目录中存储任何数据.据我所知,Linux在系统重启时清除其/tmp目录.但是我想永久存储数据.

Is there any way to store any data in Linux tmp directory. As i know Linux clear its /tmp directory when system is rebooted. But I want to store data permanently.

推荐答案

由于是Linux,因此您可以自由地(以root用户身份)执行您想做的事情.清除/tmp的时间取决于您的系统,并且可以更改;没有涉及特别的魔法.一个不错的摘要似乎在这里: https://serverfault.com/questions/377348/when-不会被清除.

Since it's linux you are free to do what you want to do (as root). When /tmp is cleared depends on your system and can be changed; there is no particular magic involved. A good summary seems to be here: https://serverfault.com/questions/377348/when-does-tmp-get-cleared.

当然,如果您是root用户,则可以设置一个完全不同的全局目录,例如"/not-quite-tmp"等.但是我认为某些不受您控制的编会写入tmp,并且您想检查或在任何情况下都保留这些文件.

Of course if you are root you can set up an entirely different global directory, say "/not-quite-tmp" or such. But I assume that some progs not under your control write to tmp and you want to inspect or in any case persist those files.

这篇关于如何在Linux的/tmp目录中永久存储数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆