Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I just got a notification saying I have a small amount of disk space left:

low disk space

so I opened baobab to investigate and noticed this:

baobab

It turns out that my /tmp folder is full of files names like tmpxxxxxx. These look to me like temporary files created by a python script.

How can I find out what program is causing this?

The timestamps vary between approximately when I first logged in to now. They are binary files and file managers see them as type 'unknown'.

lsof /tmp/tmp* gives nothing.

When I run ls -l /tmp/tmp*, the last 10 entries are:

-rw------- 1 david  david  21195909 2011-08-29 21:53 /tmp/tmpzTXYNT
-rw------- 1 david  david      2381 2011-08-29 15:53 /tmp/tmpZuKqAW
-rw------- 1 david  david   6987663 2011-08-29 18:38 /tmp/tmpZuSEp5
-rw------- 1 david  david   1789626 2011-08-29 20:33 /tmp/tmpzv3MST
-rw------- 1 david  david  19266899 2011-08-29 22:15 /tmp/tmpZxMCU5
-rw------- 1 david  david  21197879 2011-08-29 20:52 /tmp/tmpzxSXv2
-rw------- 1 david  david     65960 2011-08-29 18:13 /tmp/tmpZyA6aJ
-rw------- 1 david  david    352529 2011-08-29 22:47 /tmp/tmpzz3jPd
-rw------- 1 david  david     13869 2011-08-29 22:25 /tmp/tmp_ZZ3ZA
-rw------- 1 david  david  17277993 2011-08-29 20:53 /tmp/tmpZzSmnL
share|improve this question
    
Can you list a few of them ls -l /tmp/tmp*? –  arrange Aug 29 '11 at 22:41
    
Try strings /tmp/tmpXXX or hexdump -C /tmp/tmpXXX, then post the interesting bits. –  lesmana Aug 29 '11 at 22:54
    
Use file /tmp/tmp* to get the file types. –  Lekensteyn Aug 29 '11 at 23:06
    
The file command tells me 'data'. –  dv3500ea Aug 29 '11 at 23:08
add comment

3 Answers

How about using the inotify-tools package?

You can install it and try the following:

$ cd /tmp
$ lsof `inotifywait -e create --format "/tmp/%f" .`

If you create a file in another terminal, like:

$ cat > /tmp/aa

the lsof output might show something like

COMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
cat     3576 marcelo    1w   REG    8,1        0 274376 /tmp/aa
share|improve this answer
add comment

I just tried the lsof command again and I got this:

COMMAND     PID  USER   FD   TYPE DEVICE SIZE/OFF    NODE NAME
ubuntuone 21086 david   49r   REG    8,4  1790938 1473680 /tmp/tmpYemldG
ubuntuone 21086 david   50r   REG    8,4    12903 1473668 /tmp/tmpzZZV7s
ubuntuone 21086 david   52r   REG    8,4    21702 1473689 /tmp/tmpXrw6n8
ubuntuone 21086 david   53r   REG    8,4    25645 1473683 /tmp/tmp5jFc1h
ubuntuone 21086 david   54r   REG    8,4   275049 1473685 /tmp/tmphrw2g3
ubuntuone 21086 david   55r   REG    8,4   501273 1473684 /tmp/tmpbu2ET8
ubuntuone 21086 david   56r   REG    8,4  7027579 1473687 /tmp/tmpSY_QO8
ubuntuone 21086 david   57r   REG    8,4 19404032 1473686 /tmp/tmpokUSil
ubuntuone 21086 david   58r   REG    8,4 17277993 1473688 /tmp/tmpqjYsMG
ubuntuone 21086 david   59r   REG    8,4 21198443 1473682 /tmp/tmp1QGY_A

So it looks like Ubuntu One is the culprit. For some reason it doesn't seem to clean up after itself. I 'solved' this by killing ubuntuone-syncdaemon and then running sudo rm -f /tmp/tmp*.

share|improve this answer
add comment

Ubuntu One has a design flaw It replicates data files in /tmp. I'm talking GB of data just filling up /tmp I disabled and voila, got my disk space back (after reboot)

The basic flaw of Ubuntu One is not implementing a repository based lock on a file while updating it and doing out of place synchronization All the rest is Ubuntu One developers excuses for a poor design.

My advice - disable it .

Once a week / when you add new data enable, allow to update andthen disable it again and restart.

Terrible way, but the only way you don't lose your disk space

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.