#578: dbdump: check disk space before processing
--------------------------+----------------------
Reporter: simko | Owner: rajimene
Type: enhancement | Status: assigned
Priority: major | Milestone:
Component: MiscUtil | Version:
Resolution: | Keywords:
--------------------------+----------------------
Changes (by simko):
* status: in_merge => assigned
Comment:
The branch would not work with AFS directories where we usually backup;
see the note at the end of the original ticket description. You should
detect whether output `dirname` starts with `/afs/`, and if yes, then you
should detect available free space by parsing the output of `fs listq
dirname`. Otherwise it does not work, see:
{{{
In [23]: os.statvfs('/boot')[statvfs.F_BAVAIL]
Out[23]: 456622
In [24]: os.statvfs('/tmp')[statvfs.F_BAVAIL]
Out[24]: 702540
In [25]: os.statvfs('/opt')[statvfs.F_BAVAIL]
Out[25]: 2772101
In [26]:
os.statvfs('/afs/cern.ch/project/inspire/PROD/dbdumps')[statvfs.F_BAVAIL]
Out[26]: 9000000
In [28]:
os.statvfs('/afs/cern.ch/project/inspire/PROD/var/data/files/g5')[statvfs.F_BAVAIL]
Out[28]: 9000000
In [29]:
os.statvfs('/afs/cern.ch/project/inspire/PROD/var/data/files/g6')[statvfs.F_BAVAIL]
Out[29]: 9000000
}}}
and compare with:
{{{
$ fs listq /afs/cern.ch/project/inspire/PROD/dbdumps
Volume Name Quota Used %Used Partition
p.inspire.dbdumps 140000000 37411426 27% 69%
$ fs listq /afs/cern.ch/project/inspire/PROD/var/data/files/g5
Volume Name Quota Used %Used Partition
p.inspire.g5 10000000 4591858 46% 49%
$ fs listq /afs/cern.ch/project/inspire/PROD/var/data/files/g6
Volume Name Quota Used %Used Partition
p.inspire.g6 3000000 991528 33% 69%
}}}
You can test on your personal AFS folder.
--
Ticket URL: <https://invenio-software.org/ticket/578#comment:4>
Invenio <http://invenio-software.org>