Marcel1958
Technical User
I wrote the an script to check the file systems.
df -k | tr -d "%" | grep dev |
while read filesystem blocks free gebruik A1 iused mounted
do
if
[ "$gebruik" -gt "50" ] && [ "$mounted" = "/var/psf" ] |
[ "$gebruik" -gt "90" ] && [ "$mounted" = "/var/psf/segments" ]
then
MESSAGE="$filesystem is $gebruik % full and mounted on $mounted"
echo $MESSAGE
else
if
[ "$gebruik" -gt "60" ]
then
MESSAGE="$filesystem is xx $gebruik % full and mounted on $mounted"
echo $MESSAGE
fi
fi
done
The result of this is:
/dev/hd2 is xx 62 % full and mounted on /usr
/dev/hd9var is xx 66 % full and mounted on /var
/dev/lvpd is xx 66 % full and mounted on /var/pd
/dev/lvpsf is xx 89 % full and mounted on /var/psf
/dev/lvpsfs is xx 85 % full and mounted on /var/psf/segments
Why do ik get the line
/dev/lvpsf is xx 89 % full and mounted on /var/psf
while i excluded it in the if statement:
df -k | tr -d "%" | grep dev |
while read filesystem blocks free gebruik A1 iused mounted
do
if
[ "$gebruik" -gt "50" ] && [ "$mounted" = "/var/psf" ] |
[ "$gebruik" -gt "90" ] && [ "$mounted" = "/var/psf/segments" ]
then
MESSAGE="$filesystem is $gebruik % full and mounted on $mounted"
echo $MESSAGE
else
if
[ "$gebruik" -gt "60" ]
then
MESSAGE="$filesystem is xx $gebruik % full and mounted on $mounted"
echo $MESSAGE
fi
fi
done
The result of this is:
/dev/hd2 is xx 62 % full and mounted on /usr
/dev/hd9var is xx 66 % full and mounted on /var
/dev/lvpd is xx 66 % full and mounted on /var/pd
/dev/lvpsf is xx 89 % full and mounted on /var/psf
/dev/lvpsfs is xx 85 % full and mounted on /var/psf/segments
Why do ik get the line
/dev/lvpsf is xx 89 % full and mounted on /var/psf
while i excluded it in the if statement: