yd: Use yt-dlp instead of youtube-dl
[sunny256-utils.git] / view_df
blob22730511d0ff5374942581faa6488866b04bdb2e
1 #!/bin/sh
3 # view_df
4 # File ID: 57ae6cba-5d49-11df-ad7b-90e6ba3022ac
6 logdir=$HOME/log
7 vdtmpdir=/tmp/view_df
8 lfile=$vdtmpdir/df.log
10 [ -d $vdtmpdir/. ] || \
11 mkdir $vdtmpdir || \
12 { echo "$0: $vdtmpdir: Cannot create tempdir" >&2; exit 1; }
14 if [ "$1" = "-a" ]; then
15 rm -fv $lfile
16 for f in `cat $logdir/.disks`; do
17 view_df $f $2
18 done
19 exit 0
22 if [ ! -e $lfile ]; then
23 find $logdir/df -name '*.log' | sort | xargs zcat -f >>$lfile
26 if [ "$2" != "" ]; then
27 grep $1 $lfile | tr '\t' ' ' | tr -s ' ' | cut -d ' ' -f 1,5 | tail -$2 >$vdtmpdir/data
28 else
29 grep $1 $lfile | tr '\t' ' ' | tr -s ' ' | cut -d ' ' -f 1,5 >$vdtmpdir/data
32 cd $vdtmpdir
33 df -h $1 | grep $1 >$vdtmpdir/data.title
34 statplot