Hi. We're running AIX 4.1.5. I have to write a simple(?) cron
that checks the free space of a disk volume and send an email to a
user to inform him that the disk space is low.
I can handle the cron part, email part and checking of free disk
space. However, I'm kinda stuck when actually writing the thing.
Here's what I came up with so far:
-----------------------
#!/bin/sh
df -k /filesys1 > output #This gives info about the filesys
awk '{print $3}' output > newoutput #This gives me the word Free and
the actual disk free space
grep -v Free newoutput #This gives me the disk free space I want
-----------------------
I'm stuck at this point. How do I compare the result of the last
statement to an actual integer? How does the system know if the
number created from the grep command is actually a number and not a
string? Do I have to specify variables and variable types?
I can then run an if then statement that will check the disk free
space with a specified amount and email the results to the user.
Thanks for any help or suggestions.