2016-03-18 14:41 GMT-03:00 Dale <rdalek1...@gmail.com>:

> Neil Bothwick wrote:
> >
> >
> > Why ask the same question again when you got an answer last time?
> >
> > Hint: look at the output for asciidoc.
> > --
> > Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>
> I have to add this.  From what I understand about the scripts he is
> using, he is blindly letting emerge do updates without checking to see
> if the updates fall into line with what he *needs*.  If I read it
> correctly, any USE flag change will be missed until it hits the fan and
> is broken.  That would then mean taking a lot of time to go back through
> logs and figuring out just when it went wrong and most importantly, what
> caused it and how to fix it.  Since the change could have happened
> several updates ago, that could involve some work and a lot of rebuilding.
>
> Doing the sync in a script and even getting a email or something with
> the -p output is fine but updating blindly is not a good idea.
>
> At this point, I think I understand why he is having so much trouble.
> At the very least, check to see what USE flags are changing before doing
> updates.  There are other things that are important but that is one that
> changes a good bit.
>
> Dale
>
> :-)  :-)
>
>
>

My  $0.02.  Three scripts, at different cron entries:


$  cat update
#! /bin/bash
if ! [ -e /root/.working ]
then
    touch /root/.working
    LOG=/tmp/update.log
    LOG_TEMP=`/bin/tempfile`
    date > $LOG
    umount /usr/portage/distfiles 2> /dev/null
    mount /usr/portage/distfiles/
    /usr/sbin/emaint sync -a 1>> $LOG 2>> $LOG && \
    /usr/bin/layman -S 1>> $LOG 2>> $LOG && \
    /usr/bin/emerge -fvuDN --with-bdeps=y --complete-graph=y --backtrac=100
world 1>> $LOG 2>> $LOG && \
    /usr/bin/emerge -pvuDN --with-bdeps=y --complete-graph=y --backtrac=100
world 1>> $LOG_TEMP 2>> $LOG_TEMP && \
    cat $LOG_TEMP >> $LOG
    date >> $LOG
    echo -e \\n >> $LOG
    rm -f /root/.working
    cat $LOG_TEMP | mail -b -c -s "update system" email_addr...@domain.com
    rm -f $LOG_TEMP
fi





$ cat emerg
#! /bin/bash
LOG=/tmp/update.log
GREP_PATTERN="[<>=\*][<>=\*][<>=\*] [eEuUcCM(rN]"
if ! [ -e /root/.working ]
then
        date > $LOG
        touch /root/.working
        echo ---- ---- >> $LOG
        nice -n 10 emerge -vuDN --with-bdeps=y --complete-graph=y
--backtrac=100 --keep-going --quiet-build world 1>> $LOG 2>> $LOG
        echo ---- ---- >> $LOG
        nice -n 10 revdep-rebuild -q -i -- --quiet-build --keep-going 1>>
$LOG 2>> $LOG
        echo ---- ---- >> $LOG
        nice -n 10 emerge -vuDN --with-bdeps=y --complete-graph=y
--backtrac=100 --keep-going --quiet-build world 1>> $LOG 2>> $LOG
        echo ---- ---- >> $LOG
        nice -n 10 revdep-rebuild -q -i -- --quiet-build --keep-going 1>>
$LOG 2>> $LOG
        echo ---- ---- >> $LOG
        nice -n 10 /root/bin/xorg_rebuild 1>> $LOG 2>> $LOG
        echo ---- ---- >> $LOG
        nice -n 10 revdep-rebuild -q -i -- --quiet-build --keep-going 1>>
$LOG 2>> $LOG
        echo ---- ---- >> $LOG

        nice -n 10 /root/bin/xorg_rebuild 1>> $LOG 2>> $LOG
        echo ---- ---- >> $LOG
        nice -n 10 revdep-rebuild -q -i -- --quiet-build --keep-going 1>>
$LOG 2>> $LOG
        echo ---- ---- >> $LOG
        nice -n 10 /usr/sbin/rkhunter --propupd 1>> $LOG 2>> $LOG
        date >> $LOG
        echo -n ^D >> $LOG ; cat $LOG | mail -b -c -s "emerge
altdimtzlgt002" francisco.ares.al...@gmail.com
        rm -f /root/.working
fi

if ! [ -e /root/.workhours ]
then
        shutdown -h +1
fi


$ cat bin/xorg_rebuild
#! /bin/bash
if ! [ -e /root/.working ]
then
        touch /root/.working

        XORG_SERVER=`equery l xorg-server`
        if [ "$XORG_SERVER" != "`cat /root/xorg-server.txt`" ]
        then
                EMERGE_LIST=`equery l --format='$name' xf86*`" "`equery l
--format='$name' "xorg*"`" "`equery l --format='$name' nvidia-drivers`
                # EMERGE_LIST=`equery l --format='$name' xf86*`" "`equery l
--format='$name' "xorg*"`
                emerge -vD --with-bdeps=y --keep-going --quiet-build
$EMERGE_LIST && \
                echo $XORG_SERVER>/root/xorg-server.txt && \
                echo $NVIDIA_DRVR>/root/nvidia-drvr.txt && \
                rmmod nvidia 2>/dev/null && modprobe nvidia
        fi

        DRIVER="nvidia-drivers"
        MOD="nvidia"
        VIDEO_DRIVR=`equery l $DRIVER`
        if [ "$VIDEO_DRIVR" != "`cat /root/video-drv.txt`" ]
        then
                EMERGE_LIST=`equery l --format='$name' xf86*`" "`equery l
--format='$name' "xorg*"`" "`equery l --format='$name' $DRIVER`
                emerge -vD --with-bdeps=y --keep-going --quiet-build
$EMERGE_LIST && \
                echo $XORG_SERVER>/root/xorg-server.txt && \
                echo $VIDEO_DRIVR>/root/video-drv.txt && \
                rmmod $MOD 2>/dev/null && modprobe $MOD
        fi
        rm -f /root/.working
fi




Cron entries:

$ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXX0z8ldq installed on Tue Jan 12 09:48:35 2016)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp
$)
00 07 * * 1-5 touch /root/.workhours
30 07 * * 1-5 touch /root/.workhours
00 08 * * 1-5 touch /root/.workhours
30 08 * * 1-5 touch /root/.workhours
00 09 * * 1-5 touch /root/.workhours
30 09 * * 1-5 touch /root/.workhours
05 09 * * 1-5 /root/bin/update
30 13 * * 1-5 touch /root/.workhours
30 12 * * 1-5 /root/bin/emerg
00 20 * * 1-5 rm -f /root/.workhours

Reply via email to