Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Free Space on Disk



On Mon, 10 Dec 2001, Carsten Koch wrote:

CK> 1) from my commands.conf:
CK>
CK> 1 Disk Space:df -h|cut -c33-
CK> 2 Recordings Space:cd /video;du -skL *|sort -n|cut -c1-38
CK> 3 Film Space:cd /video;du -sk */*.rec|sort -n|cut -c1-38
                                 ^^^^^^^^
this wouldnt work if you have hierarchical recordings, e.g.
/video/Star Treck/Voyager/Episode 6.11-....rec

you can use `find /video -name "*.rec"`, but it has Problems with spaces
in names.

you also can use something like
  find /video -name "*.rec" -exec du -sk \{\} ";"
(you will have to 'cut' it properly, as the output looks like:
3147	/video/Film Name/...rec
something like 'cut -d\/ -f1,3-' would do the trick. The -c option is not
that good, as 'du' seems to use one tab character between size and name,
so it would cut something different depending on number of digits of the
size)


CK> 2) /home/cko/bin/film_time:
CK> #!/bin/sh
CK> cd /video
CK> for f in */*.rec; do
             ^^^^^^^
here the same

CK>    minutes=`ls -l $f/index.vdr | awk '{print int($5/4/50/60+0.5)}'`
CK>    name=`echo $f|cut -d/ -f1|sed 's@_@ @g'`
CK>    date=`echo $f|cut -d/ -f2|cut -c6-10`
CK>    time=`echo $f|cut -d/ -f2|cut -c12-16`
CK>    echo -e $minutes'\t'$name'  '$date'  ' $time
CK> done


c ya
        Sergei

--------------------------------------------------------------------
         eMail:       Sergei.Haller@math.uni-giessen.de
--------------------------------------------------------------------
Be careful of reading health books, you might die of a misprint.
                -- Mark Twain




Home | Main Index | Thread Index