3

This is the full file name I get when I do ls -lt from my current directory.

EXPORT_v1x0_20120811_11_T_065800_070000.dat.gz

File names also consist of date as well. In the above file date is 20120811.

So I am trying to delete all the files which starts with EXPORT_v1x0 and whose date is less than 20120825.

I am using the below script from the command line to delete the files

find . -name "EXPORT_v1x0*" | awk -F'_' '$3<20120825' | xargs rm

But whenever I use the above command to delete the files, I always get this below exception.

rm: ./EXPORT_v1x0_20120811_11_T_065800_070000.dat.gz not removed: Disc quota exceeded

Can anyone tell me what does this exception means? And how to overcome this problem?

I am running SunOS.

bash-3.00$ uname -a
SunOS lvsaishdc3in0001 5.10 Generic_142901-02 i86pc i386 i86pc
arsenal
  • 131
  • 1
  • 1
  • 4

4 Answers4

8

You'll need to do something like cat /dev/null > file (or echo > file) to get back under the quota such that you can use rm again.

2

Delete manually the tiniest files that you find until you go below quota, then you will be able to delete with the standard methods.

I don't know why @Volodymyr Savchenko's answer was downvoted. Actually that was the only trick that worked for me too.

I am working in a HPC and I ran out of quota.

-Trying pretty much any command was taking ages.

-rsync remotely with --remove-source-files was not working:

rsync -avz --remove-source-files -e "ssh -p ####" usr@host:path/file.dat ./
receiving file list ... done
rsync: sender failed to remove file.dat: Disk quota exceeded (122)

-rm most of the files was not working:

[usr@server ~]$ rm  path/file.dat
rm: cannot remove 'path/file.dat': Disk quota exceeded

-doing

cat /dev/null path/file

would apparently work, but rm'ing it wouldn't (yet with the quota exceeded error message) (which I cannot understand why).

Nevertheless, deleting tinny files that I had only 'touched', (i.e., empty files with very tinny size) would work, and gave me the chance to go below quota and be able to delete files normally.

myradio
  • 133
0

I had the same problem, and none of the usually suggested solutions, the ones you list, worked.

But I realized that it was possible to delete the smallest files < 1kb. I just had to find enough small files to be able again to clean up large ones with rm.

edit: I want to clarify that things like cat /dev/null > some-file did not work for me. It was one of the suggested solutions I mentioned.

0

I would guess that either you don't have permissions to remove the file or it's read only. Try rm -f. The quota message comes from something trying to write to disk.

ventsyv
  • 354