I'm having a problem with my script,
it's a notifier that emails me on a specific set of time then includes a statement if the file exceeds 100kb
Here is my script, how can i configure this so that it will send me the notification?
#!/bin/bash
file="afile"
maxsize=100
while true; do
actualsize=$(du -k "$file" | cut -f1)
if [ $actualsize -ge $maxsize ]
then
echo size is over $maxsize kilobytes
subject="size exceed on file $file"
emailAddr="[email protected]"
emailCmd="mail -s \"$exceedfile\" \"$emvpacifico\""
(echo ""; echo "date: $(date)";) | eval mail -s "$exceedfile" \"[email protected]\"
exit
else
echo size is under $maxsize kilobytes
fi
sleep 60
done
emailCmdand(echo ""supposed to be the same logical line, or are they separate statements?evaland remove the backslashes from the recipient address.