File Space Count

Hi
I have a volume that i want to run a daily check on to find out disk usage, and email me the results.

I have got as far as checking the size and email status. But cant seem to get the file size included into the email.

#!/bin/bash
cd /gpfs/TIER2/TAG_PRIMARY_ARCHIVE
du -sh 
echo "Exit status was: $?" | mail -s "Archive Check finished" xxxxx@tagworldwide.com

Any help appreciated
Regards
Treds

mail sends its stdin to the recipients. Your above mail 's stdin is piped from the echo statement. Try to combine du 's and echo 's outputs into the pipe...

size=`du -sh`
echo "status=$?
size=$size" |
mail ...

I think:

#!/bin/bash
cd /gpfs/TIER2/TAG_PRIMARY_ARCHIVE
( du -sh; echo "Exit status was: $?" ) |
        mail -s "Archive Check finished" xxxxx@tagworldwide.com

is closer to what treds requested.

thanks for all the responses