show-size.sh: Add disk space info when called without args
Shows free/total disk space at the end, similar to show-db-size.sh Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -60,3 +60,11 @@ dynamic=$(echo $(echo "$dynamic_kb * 1024" | bc) | numfmt --to=iec --suffix=B --
|
|||||||
echo "Total static: $static"
|
echo "Total static: $static"
|
||||||
echo "Total: $total"
|
echo "Total: $total"
|
||||||
echo "Dynamic: $dynamic"
|
echo "Dynamic: $dynamic"
|
||||||
|
|
||||||
|
# Show disk space info when called without arguments
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
echo ""
|
||||||
|
vols_free=$(df -h /var/lib/docker/volumes | awk 'NR==2 {print $4}')
|
||||||
|
vols_total=$(df -h /var/lib/docker/volumes | awk 'NR==2 {print $2}')
|
||||||
|
echo "Disk space: ${vols_free} free / ${vols_total} total"
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user