All links of one day
in a single page.
<Previous day - Next day>

rss_feedDaily RSS Feed
floral_left The Daily Shaarli floral_right
——————————— March 10, 2022 - Thursday 10, March 2022 ———————————
snippet - shell - script -

J'ai dû faire un script en shell (et non bash) et j'ai eu quelques adaptation à faire.
Du coup, je publie ici, au cas ou ca intéresse quelqu'un :


!/bin/sh

threshold=90

df -h | awk '{ print $6 " " $5 " " $4 }' |
{
while read output
do
fs=$(echo $output | awk '{ print $1}')
capacity=$(echo $output | awk '{ print $2}')
free=$(echo $output | awk '{ print $3}')

echo "$fs is used at $capacity ($free left)"

            capa=`echo $capacity | sed 's/.$//'`
            if [ $capa -gt $threshold ]; then
                    issue=true
                    result="$result $fs is used more than $threshold % ($free left)\n"
            fi
    done

    if [ $issue ]
    then
            # somthing wrong
    fi

}

-