The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   Hardware and Peripherals (http://hintsforums.macworld.com/forumdisplay.php?f=21)
-   -   OS X out of disk space when isn't (http://hintsforums.macworld.com/showthread.php?t=74988)

ThreeDee 07-11-2007 01:03 PM

So a huge PDF file is stuck in the printer spool, with nowhere to go?

accsl 07-11-2007 01:17 PM

Let's delete it so I can give my boss back his computer.

ThreeDee 07-11-2007 01:18 PM

I'm no good at sudo rm-ing anything (and I don't want to mess your Mac), so I'm gonna let someone more experienced with the terminal help out here.

hayne 07-11-2007 01:24 PM

Quote:

Originally Posted by accsl (Post 392447)
Code:

Oscars-comp:~ roadieone$ sudo file /var/spool/cups/00000255
Password:
/var/spool/cups/00000255: PDF document, version 1.3
Oscars-comp:~ roadieone$
Oscars-comp:~ roadieone$ sudo file /var/spool/cups/0000090f
/var/spool/cups/0000090f: PDF document, version 1.3
Oscars-comp:~ roadieone$ sudo file /var/spool/cups/0000198c
/var/spool/cups/0000198c: PDF document, version 1.3


So those 3 big files are PDF files.
To delete them, run the following commands:

sudo rm /var/spool/cups/00000255
sudo rm /var/spool/cups/0000090f
sudo rm /var/spool/cups/0000198c

trevor 07-11-2007 01:44 PM

I'm concerned that there are additional large files in that directory. We only looked at 30 files previously. So, before you give this computer back to your boss, can you show us the results of

sudo ls -aolS /private/var/spool/cups | head -n 30

That added -S option to ls should show us the largest 30 files in the directory.

Trevor

accsl 07-11-2007 02:35 PM

I thought that was the light at the end of the tunnel...
 
So I did it, and then I did it again, and it said that there was no such file.
so I shut down and restarted and it still seems to have the same problem.

http://www.benspot.com/problem.jpg
..

trevor 07-11-2007 03:14 PM

Yes, the three files that were deleted were too small to be the sole source of the problem.
Code:

-rw-r-----    1 root  lp    - 45702992 Jul  2 02:14 00000255
-rw-r-----    1 root  lp    - 14130568 Jul  7 21:39 0000090f
-rw-r-----    1 root  lp    -  4195752 Jul  9 10:58 0000198c

So, the first file is 45,702,992 bytes, or about 45 MB. The second file is 14,130,568 bytes, or about 14 MB. The third file is 4,195,752 bytes, or about 4 MB. You've got a lot more large files in that directory. Which is why I asked you in my previous post to show us the largest 30 files in that directory.

Could you copy/paste the command I gave above so that we can check that?

Trevor

accsl 07-11-2007 03:22 PM

Last login: Wed Jul 11 12:08:17 on ttyp1
Welcome to Darwin!
Oscars-comp:~ roadieone$ sudo ls -aolS /private/var/spool/cups | head -n 30
total 28717752
-rw-r----- 1 root lp - 82535977 Jun 29 18:19 d00179-001
-rw-r----- 1 root lp - 82535977 Jun 29 19:51 d00180-001
-rw-r----- 1 root lp - 82535977 Jun 29 21:03 d00181-001
-rw-r----- 1 root lp - 82535977 Jun 29 21:47 d00182-001
-rw-r----- 1 root lp - 82535977 Jun 29 22:03 d00183-001
-rw-r----- 1 root lp - 82535977 Jun 30 00:29 d00184-001
-rw-r----- 1 root lp - 82535977 Jun 30 00:41 d00185-001
-rw-r----- 1 root lp - 82535977 Jun 30 01:01 d00186-001
-rw-r----- 1 root lp - 82535977 Jun 30 02:24 d00187-001
-rw-r----- 1 root lp - 82535977 Jun 30 02:45 d00188-001
-rw-r----- 1 root lp - 82535977 Jun 30 03:21 d00189-001
-rw-r----- 1 root lp - 82535977 Jun 30 06:14 d00190-001
-rw-r----- 1 root lp - 82535977 Jun 30 07:12 d00191-001
-rw-r----- 1 root lp - 82535977 Jun 30 08:42 d00192-001
-rw-r----- 1 root lp - 82535977 Jun 30 09:13 d00193-001
-rw-r----- 1 root lp - 82535977 Jun 30 09:31 d00194-001
-rw-r----- 1 root lp - 82535977 Jun 30 09:47 d00195-001
-rw-r----- 1 root lp - 82535977 Jun 30 10:28 d00196-001
-rw-r----- 1 root lp - 82535977 Jun 30 11:15 d00197-001
-rw-r----- 1 root lp - 82535977 Jun 30 12:19 d00198-001
-rw-r----- 1 root lp - 82535977 Jun 30 13:17 d00199-001
-rw-r----- 1 root lp - 82535977 Jun 30 14:40 d00200-001
-rw-r----- 1 root lp - 82535977 Jun 30 16:04 d00201-001
-rw-r----- 1 root lp - 82535977 Jun 30 17:05 d00202-001
-rw-r----- 1 root lp - 82535977 Jun 30 18:18 d00203-001
-rw-r----- 1 root lp - 82535977 Jun 30 19:27 d00204-001
-rw-r----- 1 root lp - 82535977 Jun 30 19:40 d00205-001
-rw-r----- 1 root lp - 82535977 Jun 30 21:46 d00206-001
-rw-r----- 1 root lp - 82535977 Jun 30 22:19 d00207-001
Oscars-comp:~ roadieone$

trevor 07-11-2007 03:45 PM

No. In post #25, I asked that you give me the results of
sudo ls -aolS /private/var/spool/cups | head -n 30

You gave me the results of 'sudo ls -aol', and did not add the 'S'. Please copy/paste the command from post #25.

Trevor

accsl 07-11-2007 04:16 PM

Sorry.

I realized the error and edited the previous post. but apparently not before you read it.

trevor 07-11-2007 05:04 PM

Odd. That's a whole lot of 82 MB files from June 30. What happened on June 30?

In any event, to delete all files that follow that pattern, try copy/pasting the following command:

sudo rm /var/spool/cups/d0????-001

(Yes, those question marks are intended.)

Once you've done that, please show us the results of

sudo ls -aolS /var/spool/cups | head -n 50

Trevor

accsl 07-11-2007 06:51 PM

The latest...
 
Last login: Wed Jul 11 12:24:01 on ttyp1
Welcome to Darwin!
Oscars-comp:~ roadieone$ sudo rm /var/spool/cups/d0????-001
Password:
rm: /var/spool/cups/d0????-001: No such file or directory
Oscars-comp:~ roadieone$ sudo ls -aolS /var/spool/cups | head -n 50
total 28717752
-rw-r----- 1 root lp - 82535977 Jun 29 18:19 d00179-001
-rw-r----- 1 root lp - 82535977 Jun 29 19:51 d00180-001
-rw-r----- 1 root lp - 82535977 Jun 29 21:03 d00181-001
-rw-r----- 1 root lp - 82535977 Jun 29 21:47 d00182-001
-rw-r----- 1 root lp - 82535977 Jun 29 22:03 d00183-001
-rw-r----- 1 root lp - 82535977 Jun 30 00:29 d00184-001
-rw-r----- 1 root lp - 82535977 Jun 30 00:41 d00185-001
-rw-r----- 1 root lp - 82535977 Jun 30 01:01 d00186-001
-rw-r----- 1 root lp - 82535977 Jun 30 02:24 d00187-001
-rw-r----- 1 root lp - 82535977 Jun 30 02:45 d00188-001
-rw-r----- 1 root lp - 82535977 Jun 30 03:21 d00189-001
-rw-r----- 1 root lp - 82535977 Jun 30 06:14 d00190-001
-rw-r----- 1 root lp - 82535977 Jun 30 07:12 d00191-001
-rw-r----- 1 root lp - 82535977 Jun 30 08:42 d00192-001
-rw-r----- 1 root lp - 82535977 Jun 30 09:13 d00193-001
-rw-r----- 1 root lp - 82535977 Jun 30 09:31 d00194-001
-rw-r----- 1 root lp - 82535977 Jun 30 09:47 d00195-001
-rw-r----- 1 root lp - 82535977 Jun 30 10:28 d00196-001
-rw-r----- 1 root lp - 82535977 Jun 30 11:15 d00197-001
-rw-r----- 1 root lp - 82535977 Jun 30 12:19 d00198-001
-rw-r----- 1 root lp - 82535977 Jun 30 13:17 d00199-001
-rw-r----- 1 root lp - 82535977 Jun 30 14:40 d00200-001
-rw-r----- 1 root lp - 82535977 Jun 30 16:04 d00201-001
-rw-r----- 1 root lp - 82535977 Jun 30 17:05 d00202-001
-rw-r----- 1 root lp - 82535977 Jun 30 18:18 d00203-001
-rw-r----- 1 root lp - 82535977 Jun 30 19:27 d00204-001
-rw-r----- 1 root lp - 82535977 Jun 30 19:40 d00205-001
-rw-r----- 1 root lp - 82535977 Jun 30 21:46 d00206-001
-rw-r----- 1 root lp - 82535977 Jun 30 22:19 d00207-001
-rw-r----- 1 root lp - 82535977 Jun 30 22:26 d00208-001
-rw-r----- 1 root lp - 82535977 Jul 1 01:24 d00209-001
-rw-r----- 1 root lp - 82535977 Jul 1 01:37 d00210-001
-rw-r----- 1 root lp - 82535977 Jul 1 01:44 d00211-001
-rw-r----- 1 root lp - 82535977 Jul 1 03:56 d00212-001
-rw-r----- 1 root lp - 82535977 Jul 1 05:31 d00213-001
-rw-r----- 1 root lp - 82535977 Jul 1 06:33 d00214-001
-rw-r----- 1 root lp - 82535977 Jul 1 08:34 d00215-001
-rw-r----- 1 root lp - 82535977 Jul 1 10:35 d00216-001
-rw-r----- 1 root lp - 82535977 Jul 1 10:52 d00217-001
-rw-r----- 1 root lp - 82535977 Jul 1 12:19 d00218-001
-rw-r----- 1 root lp - 82535977 Jul 1 13:28 d00219-001
-rw-r----- 1 root lp - 82535977 Jul 1 14:07 d00220-001
-rw-r----- 1 root lp - 82535977 Jul 2 09:13 d00221-001
-rw-r----- 1 root lp - 82535977 Jul 2 11:10 d00222-001
-rw-r----- 1 root lp - 82535977 Jul 2 11:51 d00223-001
-rw-r----- 1 root lp - 82535977 Jul 2 13:24 d00224-001
-rw-r----- 1 root lp - 82535977 Jul 2 14:53 d00225-001
-rw-r----- 1 root lp - 82535977 Jul 2 15:12 d00226-001
-rw-r----- 1 root lp - 82535977 Jul 2 16:18 d00227-001
Oscars-comp:~ roadieone$

trevor 07-11-2007 07:34 PM

Hmm. So that didn't work.

I'm not sure why the wildcards aren't working (i.e. the ?s in the command). Perhaps someone else can explain that. Meanwhile, to get those deleted, you can use the following command, which will ask you whether you want to delete each one of those 82 MB files. If you are asked about one that doesn't follow the pattern, you may want to say no.

sudo rm -i /var/spool/cups/d0*


Once you've done that, please show us the results of

sudo ls -aolS /var/spool/cups | head -n 50

Trevor

hayne 07-11-2007 11:09 PM

Quote:

Originally Posted by trevor (Post 392592)
I'm not sure why the wildcards aren't working (i.e. the ?s in the command). Perhaps someone else can explain that.

It's because of the permissions on that folder (/var/spool/cups) and the fact that wildcards are expanded by the shell before the command is executed - i.e. before the 'sudo' is executed.

Here's an example of a similar situation:
Code:

% mkdir Stuff
% touch Stuff/foo1 Stuff/foo2 Stuff/foo3
% chmod 0 Stuff
% ls Stuff
ls: Stuff: Permission denied
% sudo ls Stuff
foo1    foo2    foo3
% sudo ls Stuff/foo?
ls: Stuff/foo?: No such file or directory


trevor 07-12-2007 12:42 AM

Quote:

Originally Posted by hayne (Post 392630)
It's because of the permissions on that folder (/var/spool/cups) and the fact that wildcards are expanded by the shell before the command is executed - i.e. before the 'sudo' is executed.

OK, then the * in my next attempt to delete these files won't work either. So how does one delete those files without

1. becoming temporary root user, such as using sudo -s, and then deleting them with wildcards, or
2. deleting every one individually, or
3. temporarily changing the permissions on the folder, removing them, and then changing the permissions back?

Trevor

hayne 07-12-2007 01:11 AM

Quote:

Originally Posted by trevor (Post 392647)
OK, then the * in my next attempt to delete these files won't work either. So how does one delete those files without

1. becoming temporary root user, such as using sudo -s, and then deleting them with wildcards, or
2. deleting every one individually, or
3. temporarily changing the permissions on the folder, removing them, and then changing the permissions back?

The easiest way is definitely using 'sudo -s' to get a root shell and then being very careful what you do in that shell and being sure to exit from it immediately afterwards.

But you could use 'find' - e.g. something like:

sudo find /var/spool/cups -name 'd0????-001' -delete

It would probably be a good idea to use the '-maxdepth' option to limit the 'find' to files directly under that folder:

sudo find /var/spool/cups -maxdepth 1 -name 'd0????-001' -delete

trevor 07-12-2007 10:57 AM

Great! Thanks Hayne.

So, accsl, can you use Hayne's command to delete the files,

sudo find /var/spool/cups -maxdepth 1 -name 'd0????-001' -delete

then follow up with

sudo ls -aolS /var/spool/cups | head -n 50

...to take a look at the 50 biggest files in the directory?

Trevor

accsl 07-12-2007 12:14 PM

I think that did it!
 
Last login: Thu Jul 12 09:02:34 on ttyp1
Welcome to Darwin!
Oscars-comp:~ roadieone$ sudo find /var/spool/cups -maxdepth 1 -name
'd0????-001' -delete
Oscars-comp:~ roadieone$ sudo ls -aolS /var/spool/cups | head -n 50
total 7056
drwx--x--- 358 root lp - 12172 Jul 12 09:07 .
-rw------- 1 root lp - 9985 Jul 10 10:02 c00357
-rw------- 1 root lp - 9985 Jul 10 10:06 c00358
-rw------- 1 root lp - 9963 Jun 29 18:19 c00179
-rw------- 1 root lp - 9963 Jun 29 19:51 c00180
-rw------- 1 root lp - 9963 Jun 29 21:03 c00181
-rw------- 1 root lp - 9963 Jun 29 21:47 c00182
-rw------- 1 root lp - 9963 Jun 29 22:03 c00183
-rw------- 1 root lp - 9963 Jun 30 00:29 c00184
-rw------- 1 root lp - 9963 Jun 30 00:41 c00185
-rw------- 1 root lp - 9963 Jun 30 01:01 c00186
-rw------- 1 root lp - 9963 Jun 30 02:24 c00187
-rw------- 1 root lp - 9963 Jun 30 02:45 c00188
-rw------- 1 root lp - 9963 Jun 30 03:21 c00189
-rw------- 1 root lp - 9963 Jun 30 06:14 c00190
-rw------- 1 root lp - 9963 Jun 30 07:12 c00191
-rw------- 1 root lp - 9963 Jun 30 08:42 c00192
-rw------- 1 root lp - 9963 Jun 30 09:13 c00193
-rw------- 1 root lp - 9963 Jun 30 09:31 c00194
-rw------- 1 root lp - 9963 Jun 30 09:47 c00195
-rw------- 1 root lp - 9963 Jun 30 10:28 c00196
-rw------- 1 root lp - 9963 Jun 30 11:15 c00197
-rw------- 1 root lp - 9963 Jun 30 12:19 c00198
-rw------- 1 root lp - 9963 Jun 30 13:17 c00199
-rw------- 1 root lp - 9963 Jun 30 14:40 c00200
-rw------- 1 root lp - 9963 Jun 30 16:04 c00201
-rw------- 1 root lp - 9963 Jun 30 17:05 c00202
-rw------- 1 root lp - 9963 Jun 30 18:18 c00203
-rw------- 1 root lp - 9963 Jun 30 19:27 c00204
-rw------- 1 root lp - 9963 Jun 30 19:40 c00205
-rw------- 1 root lp - 9963 Jun 30 21:46 c00206
-rw------- 1 root lp - 9963 Jun 30 22:19 c00207
-rw------- 1 root lp - 9963 Jun 30 22:26 c00208
-rw------- 1 root lp - 9963 Jul 1 01:24 c00209
-rw------- 1 root lp - 9963 Jul 1 01:37 c00210
-rw------- 1 root lp - 9963 Jul 1 01:44 c00211
-rw------- 1 root lp - 9963 Jul 1 03:56 c00212
-rw------- 1 root lp - 9963 Jul 1 05:31 c00213
-rw------- 1 root lp - 9963 Jul 1 06:33 c00214
-rw------- 1 root lp - 9963 Jul 1 08:34 c00215
-rw------- 1 root lp - 9963 Jul 1 10:35 c00216
-rw------- 1 root lp - 9963 Jul 1 10:52 c00217
-rw------- 1 root lp - 9963 Jul 1 12:19 c00218
-rw------- 1 root lp - 9963 Jul 1 13:28 c00219
-rw------- 1 root lp - 9963 Jul 1 14:07 c00220
-rw------- 1 root lp - 9963 Jul 2 09:13 c00221
-rw------- 1 root lp - 9963 Jul 2 11:10 c00222
-rw------- 1 root lp - 9963 Jul 2 11:51 c00223
-rw------- 1 root lp - 9963 Jul 2 13:24 c00224
Oscars-comp:~ roadieone$

Just clicked on the drive and there are 16 available gigs!
You guys are awesome! and I'm sure if I understood anything about what just happened in terminal I would be even more wowed that you were able to figure it out.
Thank you very much.
accsl


All times are GMT -5. The time now is 11:58 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.