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.

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 
:mrgreen:

you better use "du" "df".

code: select all

hp ~ # du . -s 64826032	. hp ~ #  
"man du" explain "." , "-s" you.

petero


raspberrypi



Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support