Questions tagged [tmp]
The tmp tag has no usage guidance.
155
questions
6
votes
4
answers
14k
views
Why is `systemd-tmpfiles --clean` not working?
I have the following configuration to clean up temporary files (default for CentOS 7), which says that files in /tmp should be removed if they are more than 10 days old.
[root]# tail -n +10 /usr/lib/...
1
vote
1
answer
3k
views
/dev/mapper/vg00-var maxing out
Over the past few years we have had multiple Linux servers have the same problem time and time again: our /dev/mapper/vg00-var folder maxes out at 100%, which means all sites on the server die.
We ...
109
votes
1
answer
74k
views
What happens when you 'mount over' an existing folder with contents?
Right now /tmp has some temporary files in it. When I mount my hard drive (/dev/sdc1) on top of /tmp, I can see the files on the hard drive. What happens to the actual content of /tmp when my hard ...
14
votes
3
answers
27k
views
Shall I save my crontab file in /tmp?
I ssh to a server, and want to add some daily jobs (specifially to renew Kerberos tickets even when I log out and I still want my programs in screen or tmux continue to run) to cron. So I run crontab -...
1
vote
1
answer
787
views
Cannot log in to my Debian Wheezy 7 system
I have a Debian Wheezy 7 installation. When I turn it on it boots to the log in screen normally. However when I type in my username/password and try to login the screen briefly turns off for about one ...
1
vote
1
answer
191
views
Where should generated scripts be placed in the filesystem?
I am writing a piece of software (C++) which generates Python scripts.
Where should these temporarily existing scripts be placed in the file system?
I read a couple pages about the Filesystem ...
44
votes
4
answers
51k
views
How to make a temporary file in RAM?
I have a script that will pipe its output to |tee scriptnameYYMMDD.txt. After each cycle of the for loop in which the output is generated, I'll be reversing the file contents with tac ...
3
votes
2
answers
498
views
How can I test if my /tmp "works"?
I had to delete some files and whatever, long story, I ran sudo rm -rf /tmp/.
Now, on mac (might be universal, I'm not sure) it is a symlink to /private/tmp/. But my /tmp/ folder has a thumbnail ...
273
votes
6
answers
271k
views
How create a temporary file in shell script?
While running a script, I want to create a temporary file in /tmp directory.
After execution of that script, that will be cleaned by that script.
How to do that in shell script?
5
votes
2
answers
4k
views
Firefox temporary files
In Firefox, when I choose to open a file without saving it and without an internal plugin (like a pdf or a doc file) the default behavior is that the file is saved in /tmp as a temporary file and that ...
0
votes
1
answer
729
views
Is it a bad habit to move things to tmp?
Im not sure what type of issues this could cause (might be none, of course). But when I had a folder a few days ago that could not be deleted even after running:
chflags nouchg -R
and then
sudo rm -...
59
votes
3
answers
37k
views
Finding the correct tmp dir on multiple platforms
I have a script that needs to create temporary files for its work, and clean up after itself. My question is about finding the right base directory for the temporary files.
The script needs to work ...
3
votes
3
answers
16k
views
specify mount option in /etc/fstab (mode=1777)
I have following line in my /etc/fstab:
/dev/mapper/tmp /tmp ext4 noexec,nodev,nosuid,mode=1777 0 0
When I try to mount /tmp, I get following error in dmesg:
EXT4-fs (dm-1): ...
2
votes
1
answer
2k
views
How to clean /tmp?
In general, how can we clean /tmp for freeing up the space taken by
non-needed files?
Note that I once made a mistake by deleting everything under /tmp, and then after rebooting, my Ubuntu was broken....
1
vote
1
answer
331
views
When the RAM is used up, what will happen?
When I ran ImageMagick's convert to convert and combine image files into a pdf file,
it will create 10GB temporary dirs and files in /tmp.
I am not sure if it did that all the time, or because my ...
27
votes
2
answers
9k
views
I made a mistake last night, which deleted 1800GB of my File-Server unintentionally
I ran this command yesterday, I thought on a test machine, but it was a File-Server connected through SSH.
sudo rm -rf /tmp/* !(lost+found)
My terminal emulator is Konsole. My system is Debian 7.
...
5
votes
2
answers
46k
views
"bash: cannot create temp file for here-document: No space left on device"
My / only has about 800MB free space left. I guess it is the reason that
$ convert * book.pdf
Segmentation fault (core dumped)
bash: cannot create temp file for here-document: No space left on device
...
1
vote
3
answers
111
views
Why does Debian prefer a temp file replacing the original over modifying bytes in original file?
In the mp3gain manpages, you can read the following:
-t mp3gain writes modified mp3 to temp file, then deletes
original instead of modifying bytes in original file (This ...
2
votes
0
answers
2k
views
What is the most elegant way to limit /tmp?
Recently I was struck by this tricky bug. In it, /tmp gets overflowed with symlinks until the system runs out of inodes. What is the best way to be sure that this can never happen again?
I'd like to,
...
3
votes
4
answers
3k
views
How to access temporary file straight after creation?
I've script which is connecting to remote host via SSH, creates temporary file and executing the following command:
Calling system(mysql --database=information_schema --host=localhost < /tmp/...
1
vote
1
answer
287
views
What are the files in /tmp that start with "qipc"?
There are empty files like this in my /tmp directory:
qipc_sharedmemory_soliddiskinfomemac5ffa537fd8798875c98e190df289da7e047c05
...
5
votes
1
answer
2k
views
SUID-bit not working for executables within /tmp directory
Printing the value of getuid() and geteuid() from an executable with SUID-bit (chmod +s) turned-on, seems to result with the original caller ID instead of the owner id if the executable is located ...
4
votes
2
answers
3k
views
Could you explain this "chroot" /tmp directory creation?
In the following linked article they explain how to create a "chroot" /tmp directory. I'm a bit confused by what they did. Could someone explain what the following commands are doing?
Noexec and /tmp ...
1
vote
1
answer
584
views
Accidentally garbled a bunch of file names in /tmp... ssh keys asking for passwords
I accidentally garbled the file names of the contents of my /tmp directory (don't ask) to the point where they're not recoverable.
Since doing so, I'm always asked for the password to my ssh keys (...
2
votes
2
answers
2k
views
Do Links to /tmp files get deleted?
I have a script that creates a temp directory using mktemp -d.
A folder generated in the temp directory is the output of the script that will be copied to another part of the machine.
I was ...
1
vote
1
answer
1k
views
How to install a .bin file that gives the error that it needs more space in /tmp?
Here is the error:
~]$ ./jdev_suite_121200_linux64.bin
0%....................................................................................................100%
Not enough disk space in dir /tmp/...
2
votes
1
answer
392
views
Is there a command which creates a temporary file containing the arguments passed to it?
I can paste the contents of a file into a command using cat and backticks:
ls `cat filenames`
Is there a way to do the reverse - to turn a string into a (temporary) filename?
gcc -o cpuburn `uncat "...
10
votes
5
answers
4k
views
saving in /tmp is not really saving?
Open e.g. a mail attachment from Firefox (without previously saving it); this is a Libre Office document, you edit it, and then push save (not save as) and close both text editor and browser. Then the ...
14
votes
2
answers
29k
views
When exactly does tmpwatch clear out files I place in /tmp?
CentOS 6.x
I'm confused on when exactly files I place in /tmp/ are deleted.
/etc/cron.daily/tmpwatch has the following:
#! /bin/sh
flags=-umc
/usr/sbin/tmpwatch "$flags" -x /tmp/.X11-unix -x /tmp/....
2
votes
4
answers
687
views
Wrapper command that runs program in temporary directory and deletes it after execution [duplicate]
I want to write a command that:
takes another command as its arguments
does a 'cd' to a temporary folder
executes the command passed in the arguments
removes the temporary folder afterwards
...
6
votes
3
answers
17k
views
How can I check to see if the /tmp directory on my CentOS 5.x system is mounted on tmpfs?
CentOS 5.x
My understanding is that the contents of /tmp/ in CentOS 5.x can/are automatically purged by the OS via one of two methods:
A daily cron task running tmpwatch
If /tmp/is mounted on a ...
2
votes
1
answer
1k
views
What is the tmp folder in /var?
I have a tmp folder in /var and it has the file channel.xml in it.
I don't know what this is and if it should be there and what permissions it should have because at the moment it is wide open.
Also ...
3
votes
1
answer
3k
views
Command(s) to install tempfile on CentOS 6.4
I'm looking to install the package for tempfile but am not finding it?
possibly use mktemp but I'm not sure if there is a difference in behaviour
besides a dot notation in the temp name?
$ tempfile # ...
12
votes
3
answers
864
views
bash: Some issue when using read <<<"$VARIABLE" on a read-only root partition. Any known workarounds?
Just by coincidence I had to use my ATA-ID-to-device-name script (found here: https://serverfault.com/questions/244944/linux-ata-errors-translating-to-a-device-name/426561#426561) on a read-only / ...
3
votes
1
answer
284
views
Securing /tmp on OpenVZ [closed]
/tmp should be mounted as a separate filesystem with the noexec,nosuid options set
/var/tmp should either be symlinked to /tmp or mounted as a filesystem
/dev/shm is not mounted with the noexec,nosuid ...
2
votes
1
answer
199
views
Small RAM-based /tmp
My VPS host's web interface for configuration gives me a dropdown box to set my /tmp.
The default is "16MB RAM" and the alternative is "harddisk".
Is it possible that having only 16MB of /tmp ...
9
votes
1
answer
18k
views
Yum user temp files (/var/tmp/yum*) fills up with repo data
On my rhel6 system, non-sudo users can do yum check-update. Files are then placed in /var/tmp/yum[user]*/ . The repodata there gets quite large. Can I:
Configure the location?
Configure yum so it ...
1
vote
1
answer
2k
views
Different behavior of mktemp Ubuntu 12.02 / Mint 9 Isadora
In a Bash script I use ImageMagick's convert command for doing some image processing.
I generate a temporal gif file for convert to write to.
I really need the file to have the .gif extension so ...
1
vote
0
answers
1k
views
tmp/krb5cc_[uid] is not getting purged regularly (kerberos credentials cache)
A user wasn't able to authenticate using Kerberos because it wasn't able to create /tmp/krb5cc_[uid]. This was because /tmp ran out of inode space, as there were innumerable Kerberos credential cache ...
10
votes
1
answer
5k
views
What can go wrong if /var/tmp is on a temporary filesystem?
I have read that I should not mount /var/tmp as a temporary filesystem (e.g., as tmpfs), because files in /var/tmp must not be deleted on reboot. Is that correct?
Suppose I did mount /var/tmp as a ...
7
votes
2
answers
4k
views
Is it OK to store /var/tmp on a SSD? [duplicate]
I have read that you should not store /tmp on a SSD, because the frequent writes will shorten the lifetime of the SSD. But what about /var/tmp?
Is it reasonable for /var/tmp to be stored on a SSD? ...
16
votes
4
answers
1k
views
Which folder should I write to for my intermediate files, as a dev?
I'm starting to write a few bash scripts for my project and they need some intermediate files or variables to be written.
I want to know which folders can I be sure of having access to when someone ...
18
votes
2
answers
4k
views
hook a script to apt-get
I have /tmp on a separate partition, and mounted with noexec. I am using Debian.
The installation of some packages fails, because the post-installation scripts of some packages need to run from /tmp.
...
4
votes
2
answers
1k
views
Single process accessible temporary file
I want to create a file that is only accessible to the process that created it (and potentially its children), and that disappears when the process exits, ideally never persisting the file to disk. As ...
1
vote
2
answers
5k
views
how to automatically cleanup failed PHP uploads in /tmp?
How can I automatically cleanup failed uploads?
PHP is storing them in /tmp and all file names look like phpAbCDeF (basically php followed by 6 characters).
I know that I can use the command:
find /...
1
vote
4
answers
13k
views
how to delete temp and log files with terminal on vps?
Anyone know how to delete any temp and log files or these kind of files on vps with terminal? I'm runnin debian on the vps. I can't locate those files.
102
votes
3
answers
197k
views
What are correct permissions for /tmp ? I unintentionally set it all public recursively
I have created a really really short life temporary directory that I wanted to share between some users for a few hours : /some/path/tmp
Unfortunately I have launched sudo chown 777 -R /tmp instead ...
28
votes
3
answers
35k
views
Overflow /tmp mounted when there is free space on /
I recently faced an "overflow" issue on /tmp. I don't have a separate /tmp partition, and there is 17% free in / – then why did I get an overflow tmp filesystem?
# /etc/fstab: static file ...
1
vote
4
answers
10k
views
When to mount /tmp (and other temporary directories)
When is the right time to mount /tmp (on Debian)? For /home I would not feel bad just to echo "/dev/foo /home type defaults 0 0" >>/etc/fstab - but can I be sure that /tmp is not used by any ...
1
vote
2
answers
332
views
Where does the -i option in sed store the lines matching a regex?
I am trying to release space in my server's hd so I'm matching old dates in a log file with sed and it is decreasing but my root partition is now using 98% percent of it's space instead of 91% it was ...