[Wolves] Help writing a script file
James Rogers
phb01jdr at shef.ac.uk
Thu May 18 15:53:52 BST 2006
Simon Morris wrote:
> On Thu, 2006-05-18 at 15:37 +0100, Peter Cannon wrote:
>
>> Um, sorry to be Mr Picky
>> Adminweb is the Log Title
>> 18.5.2006 is "Today's Date"
>> 14:52 is "Today's Time"
>
> Ahh, sorry. I didn't pick up on that.
>
>> Do I include the ~sm ? or is that your sig? if so that's OK.
>
>
> The SM is my sig - the script is just the text between the ----START...
> and ----END.... lines
>
>
> -----START SCRIPT-----
>
>
>
> #!/bin/bash
>
> EMAILTO=simon.morris at cmtww.com
> EMAILTO2=pete at somedomain.com
>
> mail -s "This is the subject line" "${EMAILTO}" -c "${EMAILTO2}" << EOF
>
> adminweb `date +%e.%m.%Y` `date +%H:%M`
> =====================================
>
> `tail -n 10 /var/lib/simias/log/adminweb.log`
>
> web `date +%e.%m.%Y` `date +%H:%M`
> =====================================
>
> `tail -n 10 /var/lib/simias/log/web.log`
>
>
>
> EOF
>
> -----END SCRIPT-----
#! /bin/bash
echo "adminweb.log 'date'" > temp
tail -n 10 /var/log/adminweb.log >> temp
echo "web.log 'date'" >> temp
tail -n 10 /var/log/web.log >> temp
echo "Simias.log 'date'" >> temp
tail -n 10 /var/log/Simias.log >> temp
mail -s "Log files 'date'" email at address.com < temp
ugly
More information about the Wolves
mailing list