Bash Script help please - Raspberry Pi Forums
i wrote code check amount of disk space have. problem getting error says illegal number.
resolve problem appreciative thanks.

resolve problem appreciative thanks.
code: select all
#!/bin/bash cd /home/pi/space df -h > freespace.txt find /home/pi/space/freespace.txt -type f -exec egrep -w "/dev/root" {} \; | cut -d\m -f3 > freespace2.txt find /home/pi/space/freespace2.txt -type f -exec egrep -w "" {} \; | cut -d\m -f1 > freespace3.txt space=$(cat /home/pi/space/freespace3.txt) if [ "$space" -lt "100" ]; echo "you running out of disk space!" fi

you better use "du" "df".
"man du" explain "." , "-s" you.
petero
code: select all
hp ~ # du . -s 64826032 . hp ~ #
petero
raspberrypi
Comments
Post a Comment