LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   /tmp wiped automatically? (https://www.linuxquestions.org/questions/linux-general-1/tmp-wiped-automatically-125814/)

rob19 12-14-2003 03:32 PM

/tmp wiped automatically?
 
I have a RH9 standard distro running KDE. I have setup a RAID 0 across two IDE drives resulting in a /tmp that has 350GB capacity. I am using samba to share this to Windows users. Copying files from Windows over to the Linux share is fine. However, for some reason /tmp seems to automatically wipe most of the files each night. Is this normal?

I have checked the crontab by running:
crontab -l

but it lists no scheduled tasks for root.

The Windows user is not deleting the files and has even disconnected the mapped drive one evening to eliminate that as a problem. Can anyone explain how best to fix this problem?

Shade 12-14-2003 05:46 PM

/tmp is used for system temporary files, a little like swap, but more with data caching I believe. It's not meant for user files.

Don't use it for shares, create a separate directory.

I use /share

And share it with nfs / smb.

Messing with /tmp has been known to screw with gnome/kde installations...

At least from what I've experienced once or twice and read.

-Shade

Faecal 12-14-2003 06:15 PM

Yes, it is normal for tmp to get wiped like this. Some distros come set to wipe it daily, some weekly or on reboot. As the previous poster mentioned, you shouldn't put anything in tmp that you'd be worried about vanishing without warning.

Tasks like this generally aren't in the superuser's crontab: they're in /etc/crontab. In most situations, /etc/crontab contains a series of run-parts commands which execute all the scripts in a few directories like cron.daily, cron.weekly etc. You'll probably find a script in /etc/cron.daily which is cleaning up /tmp for you.

rob19 12-14-2003 07:15 PM

Yes, under /etc/cron.daily directory is a file called tmpwatch. This is the culprit.

I have removed this file for the time being but was wondering if it was possible to set the RAID 0 to use something such as /video instead of /tmp? Or would I have to format the whole drive and reinstall Linux to setup the RAID again?

teval 12-14-2003 09:00 PM

What tmp actually is usually is a ramdisk.
You'll see if defined as a tmpfs in your /etc/fstab file. That means all the info is kept in your ram, and is just mapped onto a folder. Every time your ram looses it's data (reboot) tmp will be automatically cleaned since it's data is gone.
You can change that from tmpfs to a normal partition easily, or just delete that line and it'll go under the / (root) partition.

It's always possible to change things, reinstalling all of linux should never happen :)
I think your problem is easily solved by mounting what's currently mounted as tmp with a new name. Create the directory in / first. Haven't used raid before though, but give it a try.


All times are GMT -5. The time now is 10:28 AM.