Discussion:
/var/spool/cups/tmp
(too old to reply)
Christopher J. Basten
2004-02-11 18:32:32 UTC
Permalink
I installed Panther on a G4 back in October. Recently, I noticed that
my hard drive was filling up: I finally figured out that
/var/spool/cups/tmp had thousands of files taking up close to 21GB.
Has anyone else noticed this? I would think that the print system
would delete temporary files after they were printed. The
same directory on a 10.2.8 system is empty.

I tried to delete the files in /var/spool/cups/tmp, but there were so
many files that /bin/rm * would crash the shell. Finally, I used

find . -atime +7 -type f -exec \rm '{}' \;

run from /var/spool/cups, which deleted all files older than a week.
Aside from running a cron job to do this, does anyone know of a
switch to have the spool directory cleaned out automatically?

-Chris
Tom Harrington
2004-02-11 19:27:21 UTC
Permalink
Post by Christopher J. Basten
I installed Panther on a G4 back in October. Recently, I noticed that
my hard drive was filling up: I finally figured out that
/var/spool/cups/tmp had thousands of files taking up close to 21GB.
Has anyone else noticed this? I would think that the print system
would delete temporary files after they were printed. The
same directory on a 10.2.8 system is empty.
Yep, this is the way it works. Don't ask me why. I've never heard of
it getting to 21GB, but if you print a lot, I suppose it's possible.
There's no real upper limit, it just grows and grows.
Post by Christopher J. Basten
I tried to delete the files in /var/spool/cups/tmp, but there were so
many files that /bin/rm * would crash the shell. Finally, I used
find . -atime +7 -type f -exec \rm '{}' \;
run from /var/spool/cups, which deleted all files older than a week.
Aside from running a cron job to do this, does anyone know of a
switch to have the spool directory cleaned out automatically?
You could always use Macaroni (see below), which will take care of this
for you.
--
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0: Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/
videoxfer
2004-02-11 20:48:31 UTC
Permalink
Post by Tom Harrington
Post by Christopher J. Basten
I installed Panther on a G4 back in October. Recently, I noticed that
my hard drive was filling up: I finally figured out that
/var/spool/cups/tmp had thousands of files taking up close to 21GB.
Yep, this is the way it works. Don't ask me why.
This directory is empty on both osx machines I use. One of these
machines prints to a local usb printer, the other prints through a
spooler running on a Solaris host. I'm not running printer-sharing on
either Mac, so maybe this problem is specific to that situation.
Tom Harrington
2004-02-11 22:59:11 UTC
Permalink
Post by videoxfer
Post by Tom Harrington
Post by Christopher J. Basten
I installed Panther on a G4 back in October. Recently, I noticed that
my hard drive was filling up: I finally figured out that
/var/spool/cups/tmp had thousands of files taking up close to 21GB.
Yep, this is the way it works. Don't ask me why.
This directory is empty on both osx machines I use. One of these
machines prints to a local usb printer, the other prints through a
spooler running on a Solaris host. I'm not running printer-sharing on
either Mac, so maybe this problem is specific to that situation.
Hmm.. Perhaps it only happens if you use a shared network printer.
--
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0: Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/
Chris Schram
2004-02-11 19:54:29 UTC
Permalink
Post by Christopher J. Basten
I installed Panther on a G4 back in October. Recently, I noticed that
my hard drive was filling up: I finally figured out that
/var/spool/cups/tmp had thousands of files taking up close to 21GB.
Has anyone else noticed this?
Interesting. On my Panther G4 I had 42 files in that directory dating
from August through October of last year.

Also interesting is that I couldn't use sudo cd to get to that
directory. I had to su root before I could go in there and delete those
files.
--
***@webenet.net is a filtered spam magnet. Email replies may not
get through. Use cschram instead. <http://www.webenet.net/~schram/>
C's Attic Sale <http://www.webenet.net/~schram/Chris/sale.html>
M's Music Sale <http://www.webenet.net/~schram/Martha/Music4Sale.html>
Christopher J. Basten
2004-02-11 20:05:17 UTC
Permalink
Post by Chris Schram
Post by Christopher J. Basten
I installed Panther on a G4 back in October. Recently, I noticed that
my hard drive was filling up: I finally figured out that
/var/spool/cups/tmp had thousands of files taking up close to 21GB.
Has anyone else noticed this?
Interesting. On my Panther G4 I had 42 files in that directory dating
from August through October of last year.
Also interesting is that I couldn't use sudo cd to get to that
directory. I had to su root before I could go in there and delete those
files.
I discovered something else. I found that if I killed /usr/sbin/cupsd,
then the files stopped appearing. This also meant that I couldn't
print. Next, I restarted /usr/sbin/cupsd, and the files started
reappearing. Finally, I killed the 'Server Admin' app (which had been
running), and the files stopped appearing, even though /usr/sbin/cupsd
was running. I think that there is a bug in Server Admin that is the
culprit. I had been using Server Admin to manage a cluster I had set
up. It looks like Server Admin was creating about 40-50 files a
minute, and they looked like printer control files.
Tom Harrington
2004-02-11 20:51:41 UTC
Permalink
Post by Christopher J. Basten
I discovered something else. I found that if I killed /usr/sbin/cupsd,
then the files stopped appearing. This also meant that I couldn't
print. Next, I restarted /usr/sbin/cupsd, and the files started
reappearing. Finally, I killed the 'Server Admin' app (which had been
running), and the files stopped appearing, even though /usr/sbin/cupsd
was running. I think that there is a bug in Server Admin that is the
culprit. I had been using Server Admin to manage a cluster I had set
up. It looks like Server Admin was creating about 40-50 files a
minute, and they looked like printer control files.
It's possible that you're seeing something specific to server setups.
However it's by no means necessary for Server Admin to be running for
CUPS temp files to pile up in that directory-- it'll happen on any Mac
(with 10.2 or better) that people print from.
--
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0: Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/
Jussi Piitulainen
2004-02-11 20:49:15 UTC
Permalink
Post by Chris Schram
Also interesting is that I couldn't use sudo cd to get to that
directory. I had to su root before I could go in there and delete
those files.
That would be because cd is a shell builtin, not a separate program
for sudo to run. You could sudo ls to see what is there and then sudo
rm /var/cups/tmp/whatever a specific file called whatever, or sudo
bash to get a root shell.
--
Andre Berger
2004-02-11 23:23:56 UTC
Permalink
Post by Christopher J. Basten
I installed Panther on a G4 back in October. Recently, I noticed that
my hard drive was filling up: I finally figured out that
/var/spool/cups/tmp had thousands of files taking up close to 21GB.
Has anyone else noticed this? I would think that the print system
would delete temporary files after they were printed. The
same directory on a 10.2.8 system is empty.
I tried to delete the files in /var/spool/cups/tmp, but there were so
many files that /bin/rm * would crash the shell. Finally, I used
find . -atime +7 -type f -exec \rm '{}' \;
run from /var/spool/cups, which deleted all files older than a week.
Aside from running a cron job to do this, does anyone know of a
switch to have the spool directory cleaned out automatically?
-Chris
Hi Chris,

why not have the temporary files created in /tmp, which would erase them on
every system startup? This is done in /etc/cups/cupsd.conf:

# TempDir: the directory to put temporary files in. This directory must be
# writable by the user defined above! Defaults to "/private/var/spool/cups/tmp" or
# the value of the TMPDIR environment variable.
#
#TempDir /private/var/spool/cups/tmp
TempDir /tmp

If you change anything here, restart cupsd. On a production server system, I'd
also go with the cron job just to be on the safe side.

-Andre
Kevin McMurtrie
2004-02-12 05:17:46 UTC
Permalink
Post by Christopher J. Basten
I installed Panther on a G4 back in October. Recently, I noticed that
my hard drive was filling up: I finally figured out that
/var/spool/cups/tmp had thousands of files taking up close to 21GB.
Has anyone else noticed this? I would think that the print system
would delete temporary files after they were printed. The
same directory on a 10.2.8 system is empty.
I tried to delete the files in /var/spool/cups/tmp, but there were so
many files that /bin/rm * would crash the shell. Finally, I used
find . -atime +7 -type f -exec \rm '{}' \;
run from /var/spool/cups, which deleted all files older than a week.
Aside from running a cron job to do this, does anyone know of a
switch to have the spool directory cleaned out automatically?
-Chris
The bug has always been there. For some printers, the temp directory
can easily suck down many gigabytes.

Continue reading on narkive:
Search results for '/var/spool/cups/tmp' (Questions and Answers)
4
replies
why am I losing disk space on my mac?
started 2009-07-29 09:42:06 UTC
desktops
Loading...