On Fri, 22 Aug 2003 09:17 pm, Spider wrote:

> Reshuffle "emerge sync"  and the pipe redirected "emerge -uvp"  so
> they are before the echo lines. This will reduce the time that your
> script is blocking sendmail.
>
> You should also move that file to $HOME instead, that will relieve some
> file-overwrite problems. (ln -s /etc/passwd /tmp/pgk.tmp ....)
>
>
> //Spider

Thanks spider, here is the updated script:

#!/bin/sh

emerge sync > /dev/null

emerge -uDpv world > /root/pkg.tmp

(
   echo "To: [EMAIL PROTECTED] <blade->"
   echo "From: system <root>"
   echo "Subject: Updates available"
   echo The following updates are available:
   echo

cat /root/pkg.tmp | grep ebuild ) 2>&1 | /usr/sbin/sendmail -t

rm /root/pkg.tmp


Does it matter about the emerge sync > /dev/null, it was coming back with some 
sort of error with 2>&1 so I was recieving another email from crontab with 
usr/bin/updates: line 2:
anyway it seems to be working


--
[EMAIL PROTECTED] mailing list

Reply via email to