Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Automatic updates...
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
dj_farid
l33t
l33t


Joined: 14 Jun 2004
Posts: 613

PostPosted: Thu Jun 17, 2004 12:04 am    Post subject: Automatic updates... Reply with quote

I have my newly installed gentoo box up and running.
I would like it to update all the software automatically during the night. I was thinking of putting a script with emerge world in cron. What would be the nicest and best wat to do this? Would be nice to have somekind of logfile put somewhere that I could read every other day, just to see that all went ok.
Maybe someone has such a script already? Any thoughts on this are welcome. Thanks.
Back to top
View user's profile Send private message
dhurt
Apprentice
Apprentice


Joined: 14 May 2003
Posts: 278
Location: Davis, CA

PostPosted: Thu Jun 17, 2004 12:25 am    Post subject: Reply with quote

The log files for emerging can be found at:

/var/log/emerge

Here is the script that I use to update my packages every night with a cron job. Actually it runs right after I emerge sync. It builds all the packages that need to be upgraded. It then emails the info to you so you can install at your leasure. I found this script on the forums awhile ago and I am sorry that I cannot remeber who actually wrote it.

Code:

#!/bin/bash

# Find What Packages Need Upgrading on this System
Send an Email
(
echo "Subject: Preliminary World Update - portage_update.sh";
echo "To: root";
echo "From: Cron Daemon <root@$(hostname)>";
echo;

#Build the Binary Packages
# To Install the Binary Package run the following Command:
#      emerge -K packagename
for package in ` /usr/bin/emerge --pretend --deep --nospinner world | grep ebuild | cut -f 2- -d "/" | cut -f 1 -d " " ` ;
   do
      if [ -f /usr/portage/packages/All/$package.tbz2 ]
      then echo "           Binary package $package exists, but it's not installed."
      else echo "Binary package $package doen't exist, emerging..."
           /usr/bin/nice -n +19 /usr/bin/emerge --buildpkgonly --oneshot --nospinner =$package
      fi
   done
) | fold -sw 160 | /usr/lib/sendmail -F"Cron Daemon" -f"root" root

_________________
"And isn't sanity really just a one-trick pony, anyway? I mean, all you get is one trick, rational thinking, but when you're good and crazy, ooh ooh ooh, the sky's the limit!" -- The Tick
Back to top
View user's profile Send private message
kamagurka
Veteran
Veteran


Joined: 25 Jan 2004
Posts: 1026
Location: /germany/munich

PostPosted: Thu Jun 17, 2004 10:33 am    Post subject: Reply with quote

having a cron job that emerge syncs is abusive to the rsync servers (at least if it does it nightly). syncing that often is quite exaggerated.
also, having a script emerge unsupervised is dangerous as you might miss the etc-updates. these *have* to be supervised and cannot be automated.
_________________
If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word
Back to top
View user's profile Send private message
dhurt
Apprentice
Apprentice


Joined: 14 May 2003
Posts: 278
Location: Davis, CA

PostPosted: Thu Jun 17, 2004 6:47 pm    Post subject: Reply with quote

It is really not that abusive in my situation. I have one mirror that feeds 8 different computers here, and I like to have that mirror upto date.

I also have http-replicator setup so that I only have to download the packages once for the 8 computers that I have. I really try my hardest to go easy on the mirrors. :? All types. Let me know if you still feel that is abusive to have my main mirror here sync once a day.
_________________
"And isn't sanity really just a one-trick pony, anyway? I mean, all you get is one trick, rational thinking, but when you're good and crazy, ooh ooh ooh, the sky's the limit!" -- The Tick
Back to top
View user's profile Send private message
kamagurka
Veteran
Veteran


Joined: 25 Jan 2004
Posts: 1026
Location: /germany/munich

PostPosted: Thu Jun 17, 2004 6:52 pm    Post subject: Reply with quote

dhurt wrote:
It is really not that abusive in my situation. I have one mirror that feeds 8 different computers here, and I like to have that mirror upto date.

I also have http-replicator setup so that I only have to download the packages once for the 8 computers that I have. I really try my hardest to go easy on the mirrors. :? All types. Let me know if you still feel that is abusive to have my main mirror here sync once a day.

if you feed 8 stations of it, it's not abusive. it's still a bit exagerrated, imho. (i mean, look at the logs: in how many cases is something really updated? work something out based on that; i'd say your computers are plenty updated even if you just sync every third day.)

but good job on that emerge-cascading setup you got going on.
_________________
If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word
Back to top
View user's profile Send private message
dhurt
Apprentice
Apprentice


Joined: 14 May 2003
Posts: 278
Location: Davis, CA

PostPosted: Thu Jun 17, 2004 8:35 pm    Post subject: Reply with quote

Yeah, I do see your point, probably only one-two packages get updates to the every day. ( I run "~x86" machines so the update cycle is abit faster than x86 ). I might tone down the update to every two or three days. The mirrors are providing this service free of charge and we should do everything possible to minimize cost ;)

[edit]
PS the irc chat quotes in the link from your sig are awesome :D
_________________
"And isn't sanity really just a one-trick pony, anyway? I mean, all you get is one trick, rational thinking, but when you're good and crazy, ooh ooh ooh, the sky's the limit!" -- The Tick
Back to top
View user's profile Send private message
keto
n00b
n00b


Joined: 25 Jun 2003
Posts: 13

PostPosted: Fri Jun 18, 2004 3:59 pm    Post subject: Reply with quote

But say if a updated package i.e. apache and it got 2 dependencies libwww, openssl so if you use --buildpkgonly, apache will get linked to the old libraries installed on the system, is there a good way to solve this without installing package and then emerge it?

Maybe you want to make a binary package over night but not emerge it, and install it when you get time, because you want to know what is happening and run etc-update..
Back to top
View user's profile Send private message
dhurt
Apprentice
Apprentice


Joined: 14 May 2003
Posts: 278
Location: Davis, CA

PostPosted: Fri Jun 18, 2004 4:50 pm    Post subject: Reply with quote

keto wrote:
But say if a updated package i.e. apache and it got 2 dependencies libwww, openssl so if you use --buildpkgonly, apache will get linked to the old libraries installed on the system, is there a good way to solve this without installing package and then emerge it?.


If you are keeping up on your updates this should not be a problem. Also, if you are using --buildpkgonly, the package will not build if a dependency needs to be upgraded, just for this reason so you are reasonably safe.


keto wrote:
Maybe you want to make a binary package over night but not emerge it, and install it when you get time, because you want to know what is happening and run etc-update..


This is exactly the reason. I like to watch the upgrades happen, but this allows me to not have to wait for all the compiling to finish.

PS you should not use etc-update, use dispatch-conf instead of etc-update, much much nicer :D

https://forums.gentoo.org/viewtopic.php?t=184107&highlight=dispatchconf
_________________
"And isn't sanity really just a one-trick pony, anyway? I mean, all you get is one trick, rational thinking, but when you're good and crazy, ooh ooh ooh, the sky's the limit!" -- The Tick
Back to top
View user's profile Send private message
keto
n00b
n00b


Joined: 25 Jun 2003
Posts: 13

PostPosted: Fri Jun 18, 2004 10:16 pm    Post subject: Reply with quote

dhurt wrote:
If you are keeping up on your updates this should not be a problem. Also, if you are using --buildpkgonly, the package will not build if a dependency needs to be upgraded, just for this reason so you are reasonably safe.


Will emerge output a error message and telling you can't compile or will it just ignore it?
Back to top
View user's profile Send private message
dhurt
Apprentice
Apprentice


Joined: 14 May 2003
Posts: 278
Location: Davis, CA

PostPosted: Sat Jun 19, 2004 1:39 am    Post subject: Reply with quote

Emerge will output an error, for instance:

Code:

# emerge --buildpkgonly gnome
Calculating dependencies ...done!

!!! --buildpkgonly requires all dependencies to be merged.
!!! Cannot merge requested packages. Merge deps and try again.

_________________
"And isn't sanity really just a one-trick pony, anyway? I mean, all you get is one trick, rational thinking, but when you're good and crazy, ooh ooh ooh, the sky's the limit!" -- The Tick
Back to top
View user's profile Send private message
keto
n00b
n00b


Joined: 25 Jun 2003
Posts: 13

PostPosted: Sat Jun 19, 2004 9:27 am    Post subject: Reply with quote

Thats good, so once in a while you will have to do a emerge manualy because of dep "collision".
Back to top
View user's profile Send private message
dhurt
Apprentice
Apprentice


Joined: 14 May 2003
Posts: 278
Location: Davis, CA

PostPosted: Sun Jun 20, 2004 5:35 pm    Post subject: Reply with quote

Exactly. :D
_________________
"And isn't sanity really just a one-trick pony, anyway? I mean, all you get is one trick, rational thinking, but when you're good and crazy, ooh ooh ooh, the sky's the limit!" -- The Tick
Back to top
View user's profile Send private message
dj_farid
l33t
l33t


Joined: 14 Jun 2004
Posts: 613

PostPosted: Thu Jul 01, 2004 11:51 am    Post subject: Reply with quote

There seems to be some problems with my mail.
What needs to be done? I have sendmail installed with the default config files. Where do I look?

Quote:

Jul 1 02:30:00 farid CRON[27003]: (root) CMD (/usr/local/sbin/portage_update.sh)
Jul 1 02:30:34 farid sSMTP[27008]: Unable to locate mail
Jul 1 02:30:34 farid sSMTP[27008]: Cannot open mail:25
Jul 1 02:30:34 farid sSMTP[27028]: Unable to locate mail
Jul 1 02:30:34 farid sSMTP[27028]: Cannot open mail:25
Jul 1 02:30:34 farid CRON[27001]: (root) MAIL (mailed 30 bytes of output but got status 0x0001 )
Back to top
View user's profile Send private message
kamagurka
Veteran
Veteran


Joined: 25 Jan 2004
Posts: 1026
Location: /germany/munich

PostPosted: Thu Jul 01, 2004 12:46 pm    Post subject: Reply with quote

dj_farid wrote:
There seems to be some problems with my mail.
What needs to be done? I have sendmail installed with the default config files. Where do I look?

Quote:

Jul 1 02:30:00 farid CRON[27003]: (root) CMD (/usr/local/sbin/portage_update.sh)
Jul 1 02:30:34 farid sSMTP[27008]: Unable to locate mail
Jul 1 02:30:34 farid sSMTP[27008]: Cannot open mail:25
Jul 1 02:30:34 farid sSMTP[27028]: Unable to locate mail
Jul 1 02:30:34 farid sSMTP[27028]: Cannot open mail:25
Jul 1 02:30:34 farid CRON[27001]: (root) MAIL (mailed 30 bytes of output but got status 0x0001 )


what does this have to do with anything?
_________________
If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word
Back to top
View user's profile Send private message
smces
Tux's lil' helper
Tux's lil' helper


Joined: 29 Feb 2004
Posts: 100
Location: North Wales

PostPosted: Thu Jul 01, 2004 1:02 pm    Post subject: Reply with quote

I think he's trying to use that script :wink:
Back to top
View user's profile Send private message
kamagurka
Veteran
Veteran


Joined: 25 Jan 2004
Posts: 1026
Location: /germany/munich

PostPosted: Thu Jul 01, 2004 1:09 pm    Post subject: Reply with quote

smces wrote:
I think he's trying to use that script :wink:


duh. i'll shut up now.
_________________
If you loved me, you'd all kill yourselves today.
--Spider Jerusalem, the Word
Back to top
View user's profile Send private message
dj_farid
l33t
l33t


Joined: 14 Jun 2004
Posts: 613

PostPosted: Thu Jul 01, 2004 1:49 pm    Post subject: Reply with quote

Yes I try to run the script and I get a message that it cannot open mail.
What needs to be done?
Back to top
View user's profile Send private message
dhurt
Apprentice
Apprentice


Joined: 14 May 2003
Posts: 278
Location: Davis, CA

PostPosted: Thu Jul 01, 2004 4:52 pm    Post subject: Reply with quote

If you do not have a mail server running for local delivery, like postfix or some thing like that. You could just comment out the mail lines like this:

Code:

#!/bin/bash

# Find What Packages Need Upgrading on this System

#Build the Binary Packages
# To Install the Binary Package run the following Command:
#      emerge -K packagename
for package in ` /usr/bin/emerge --pretend --deep --nospinner world | grep ebuild | cut -f 2- -d "/" | cut -f 1 -d " " ` ;
   do
      if [ -f /usr/portage/packages/All/$package.tbz2 ]
      then echo "           Binary package $package exists, but it's not installed."
      else echo "Binary package $package doen't exist, emerging..."
           /usr/bin/nice -n +19 /usr/bin/emerge --buildpkgonly --oneshot --nospinner =$package
      fi
    done


Or you could head over to the howto section and try and setup the home email system.
_________________
"And isn't sanity really just a one-trick pony, anyway? I mean, all you get is one trick, rational thinking, but when you're good and crazy, ooh ooh ooh, the sky's the limit!" -- The Tick
Back to top
View user's profile Send private message
untiefe
Apprentice
Apprentice


Joined: 12 Jan 2004
Posts: 230
Location: the nonexisting Bielefeld, Germany

PostPosted: Fri Jul 02, 2004 1:28 pm    Post subject: Reply with quote

*** Finally the new glcu is out! You can find it here: http://www.panhorst.com/glcu/ Please test it!

I leave this thread just for historical reasons, and won't modify it any further!

-------------------------------------------------------------------------------------------------------

glcu - gentoo linux cron update

This thread made me think about a better way for automatic updates and encouraged by dhurt's script, I updated my own bash-script. I developed this script over the last months, so that it got better and better (I hope).
If you want to use it, just put it in /etc/cron.weekly (or if you really hate your Gentoo mirror in /etc/cron.daily) change the eMail-setting at the top of the script and set, if you want to update your 'world' or just your 'system'. You need to have 'mailx', 'gentoolkit' and 'esearch' emerged.

Short description (What does this script do?):
1. emerge sync
2. run fixpackages, if needed
3. check for new GLSAs
4. if errors ocurred during emerge sync or if there are new GLSAs, glcu sends an eMail to tell you
5. check for new packages (emerge system or emerge world)
6. prebuild new packages if all dependencies are met
7. send another email (if there are packages that need an update), that tells you how to update your gentoo box (using the prebuilt packages)


I hope you like it :)
Post a reply if you found a bug or need another feature! (see here as well)


EDIT (05.07.04): Code was updated to Version 0.2
2nd EDIT (09.07.04): Code was updated to Version 0.3 - (glsa-check is run after the emerge sync now)
3rd EDIT: small bugfix, changed package path
4th EDIT (20.07.04): added automatic 'fixpackages' if needed and repaired the RegExp for [N]
5th EDIT (26.07.04): code cleanup and renaming from esync to "glcu - gentoo linux cron update" (there already is a program called esync)
6th EDIT(29.07.04): minor bugfixes
7th EDIT (03.08.04): and one month of developing :-) - Version 0.52 should be fine to use on most systems (like my office PC)
8th EDIT (12.08.04): Version 0.6 - Made the output (eMails) prettier and more readable + some more bugfixes
9th EDIT (16.08.04): Version 0.61 - added $HOSTNAME to subjects and some minor bugfixes
10th EDIT (19.08.04): Version 0.62 - little code cleanup
11th EDIT (11.11.04): Version 0.63 - repaired glsa-check function
12th EDIT (15.11.04): Version 0.64 - repaired the repair :-( In the new python version, this stuff will be a lot nicer (if I ever finish it)

13th EDIT (27.12.04): Version 0.65 - added -n option to glsa-check and used easier grep again. Thanx to CrashNBurns!
Code:

#!/bin/bash
#
#
# glcu - gentoo linux cron update
# script for keeping your Gentoo linux up to date
#
# Version 0.65 - written by Michael Panhorst - Michael [at] untiefe [dot] de
#
# put this script in the /etc/cron.weekly directory
# You need to have mailx, esearch and gentoolkit emerged


# Set your eMail address first:
EMAILADRESS=root

# set if you want to test (and build) emerge 'system' or 'world'
UPDATE=system


################################################################
# You shouldn't need to change anything below this line


PKGDIR="/usr/portage/packages"
source /etc/make.conf  # in case you set PKGDIR different
SUBJECT="glcu: New ebuilds for emerge $UPDATE on $HOSTNAME"
FS=""
EXTRA=""

# 1. emerge sync ############## (sync first) ####################

emerge sync 2>/tmp/emergesync.$$

# and run fixpackages (if needed)

grep "Skipping packages. Run 'fixpackages' or set it in FEATURES" /tmp/emergesync.$$

if [ $? == 0 ]
    then
    echo "" >>/tmp/ecdep.$$
    echo "Running fixpackages" >>/tmp/ecdep.$$
    echo "" >>/tmp/ecdep.$$
    fixpackages 2>>/tmp/ecdep.$$
    echo "" >>/tmp/ecdep.$$
fi

# 2. update database for esearch ################################

eupdatedb 2>>/tmp/emergesync.$$

# 3. glsa-check - check for security updates ####################

glsa-check -l -n|grep " \[N\] " >/tmp/eupdate.$$
if [ $? == 0 ]
    then
    echo "" >>/tmp/emergesync.$$
    echo "----------------------------------------------------------------------" >>/tmp/emergesync.$$
    echo "Important Security updates for $HOSTNAME:" >>/tmp/emergesync.$$
    echo "" >>/tmp/emergesync.$$
    cat /tmp/eupdate.$$ >> /tmp/emergesync.$$
    echo "" >>/tmp/emergesync.$$
    echo "" >>/tmp/emergesync.$$
    echo "*** Run 'glsa-check --fix new' to auto-apply all security updates" >>/tmp/emergesync.$$
    echo "         ====================" >>/tmp/emergesync.$$
    echo "" >>/tmp/emergesync.$$
    echo "----------------------------------------------------------------------" >>/tmp/emergesync.$$

    FS="- SECURITY UPDATES!"
fi

# only send a mail if errors ocurred
if [ -s /tmp/emergesync.$$ ]
then
    if [ -s /tmp/ecdep.$$ ]
   then
   cat /tmp/ecdep.$$ >> /tmp/emergesync.$$
    fi
   cat /tmp/emergesync.$$ | mail -s "glcu($HOSTNAME): emerge sync $FS" $EMAILADRESS
fi



# 4. emerge -pv system/world (check for needed/new ebuilds) ###

emerge --pretend --deep $UPDATE > /tmp/eupdate.$$ 2>&1

# prebuild (emerge --buildpkgonly) all needed packages

grep ebuild /tmp/eupdate.$$

if [ $? == 0 ]
    then
    echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" >> /tmp/ecdep.$$
    echo "List of new Packages:" > /tmp/ecdep.$$
    echo "---------------------" >> /tmp/ecdep.$$
    grep ebuild /tmp/eupdate.$$ >> /tmp/ecdep.$$
    echo "---------------------------------------------------------------------" >> /tmp/ecdep.$$

    for package in `cat /tmp/eupdate.$$ | grep ebuild | cut -f 2- -d "/" | cut -f 1 -d " "` ;
      do
      if [ ! -f $PKGDIR/All/$package.tbz2 ]
     then
     echo "" >> /tmp/ecdep.$$
     echo "Building binary package for $package :" >> /tmp/ecdep.$$

     emerge --pretend --buildpkgonly --oneshot =$package > /tmp/eupdate.$$
     if [ ` grep -c ebuild /tmp/eupdate.$$ ` == 1 ]
         then
         nice -n +19 emerge --buildpkgonly --oneshot =$package 2>> /tmp/ecdep.$$
         if [ $? == 0 ]
        then
        PACKAGES="$PACKAGES =$package"
        else
        echo "" >> /tmp/ecdep.$$
        echo " ***  Error while building $package!" >> /tmp/ecdep.$$
        SUBJECT="glcu: DEPENDENCY PROBLEM, COULDN'T PREBUILD ALL PACKAGES ON $HOSTNAME"
        DEP=1
         fi

         else
         echo " *** Dependencies for $package not met." >> /tmp/ecdep.$$
         echo " *** Cannot prebuilt $package!" >> /tmp/ecdep.$$
         SUBJECT="glcu: DEPENDENCY PROBLEM, COULDN'T PREBUILD ALL PACKAGES ON $HOSTNAME"
         DEP=1
     fi

      fi
    done

    echo "New packages for 'emerge $UPDATE'!" > /tmp/glcu.$$
    echo "                  =============" >> /tmp/glcu.$$
    echo "" >> /tmp/glcu.$$

    if [ -n "$PACKAGES" ]
   then
   echo "To update your gentoo linux, execute:" >> /tmp/glcu.$$
   echo "" >> /tmp/glcu.$$
   echo "  emerge -avK $PACKAGES" >> /tmp/glcu.$$
   echo "" >> /tmp/glcu.$$
   EXTRA=further
   SEND=1
    fi

    if [ $DEP ]
   then
   echo "check for $EXTRA packages with:" >> /tmp/glcu.$$
   echo "" >> /tmp/glcu.$$
   echo "  emerge -av $UPDATE" >> /tmp/glcu.$$
   echo "" >> /tmp/glcu.$$
   SEND=1
    fi


    cat /tmp/ecdep.$$ >> /tmp/glcu.$$

    # send mail, how to update the system

    if [ $SEND ]
   then
   cat /tmp/glcu.$$ | mail -s "$SUBJECT" $EMAILADRESS
    fi

# rm all used files

    rm /tmp/glcu.$$

fi

rm /tmp/emergesync.$$ /tmp/eupdate.$$ /tmp/ecdep.$$


_________________
"I'm an angel bored like hell
And you're a devil meaning well"

:: Cardigans - You're The Storm ::

glcu - gentoo linux cron update (full featured semi-automatic updates via cron)


Last edited by untiefe on Thu Feb 24, 2005 4:27 pm; edited 24 times in total
Back to top
View user's profile Send private message
robfantini
Tux's lil' helper
Tux's lil' helper


Joined: 10 Jan 2004
Posts: 106
Location: Boston, Massachusetts

PostPosted: Mon Jul 12, 2004 11:51 am    Post subject: Reply with quote

I suggest putting output of eupdatedb to /dev/null to shorten the mail:


# 2. updatedb for esearch
eupdatedb >/dev/null 2>>/tmp/emergesync.$$



ps:
these scripts are a great help! thanks
Back to top
View user's profile Send private message
untiefe
Apprentice
Apprentice


Joined: 12 Jan 2004
Posts: 230
Location: the nonexisting Bielefeld, Germany

PostPosted: Mon Jul 12, 2004 12:48 pm    Post subject: Reply with quote

robfantini wrote:
I suggest putting output of eupdatedb to /dev/null to shorten the mail:


# 2. updatedb for esearch
eupdatedb >/dev/null 2>>/tmp/emergesync.$$


Only errors (that is the 2 before the >>) are saved in emergesync. So normally you won't see anything from eupdatedb to lengthen the email
_________________
"I'm an angel bored like hell
And you're a devil meaning well"

:: Cardigans - You're The Storm ::

glcu - gentoo linux cron update (full featured semi-automatic updates via cron)
Back to top
View user's profile Send private message
robfantini
Tux's lil' helper
Tux's lil' helper


Joined: 10 Jan 2004
Posts: 106
Location: Boston, Massachusetts

PostPosted: Tue Jul 13, 2004 2:47 am    Post subject: Reply with quote

When I run the script from crontab, I do get a long mail.. Same was true with the script at the start of this thread..
Back to top
View user's profile Send private message
dhurt
Apprentice
Apprentice


Joined: 14 May 2003
Posts: 278
Location: Davis, CA

PostPosted: Tue Jul 13, 2004 2:57 am    Post subject: Reply with quote

You will, that is how crontab functions. If you do not want the output from a command, you could modify my script or any script to redirect the output to /dev/null. So for instance:
Code:

      else echo "Binary package $package doen't exist, emerging..."
           /usr/bin/nice -n +19 /usr/bin/emerge --buildpkgonly --oneshot --nospinner =$package &> /dev/null
      fi


Where the "&>" redirects all output. You can use "1>" and "2>" to redirect stdout and stderr respectively to different places as well if you want.
_________________
"And isn't sanity really just a one-trick pony, anyway? I mean, all you get is one trick, rational thinking, but when you're good and crazy, ooh ooh ooh, the sky's the limit!" -- The Tick
Back to top
View user's profile Send private message
untiefe
Apprentice
Apprentice


Joined: 12 Jan 2004
Posts: 230
Location: the nonexisting Bielefeld, Germany

PostPosted: Tue Jul 20, 2004 7:54 am    Post subject: Reply with quote

robfantini wrote:
When I run the script from crontab, I do get a long mail.. Same was true with the script at the start of this thread..


I'm using vixie-cron, and I only get a mail if there were some errors during 'emerge sync' or 'eupdatedb' (and if there were errors, I want to know them) or if there is a new GLSA that may affect the system.
Then the script checks for new ebuilds and writes a 2nd eMail if (and only if) there are packages that need/have an update.

If there is any error during the updates, I want to know. Otherwise my system may break and I notice it too late. And I want to do the update of the packages myself, to stay in control (then I can react quickly if anything goes wrong). But the update should run as quick as possible, therefore the new ebuild are prebuild and the cronjob tells you exactly what to do...

If you run this script once a week (as suggested) you will get (nearly always) two mails, because there probably are packages that need updating and there are GLSA's as well, but they only tell you what to do to update your system and may show you some errors during syncing or prebuilding...
_________________
"I'm an angel bored like hell
And you're a devil meaning well"

:: Cardigans - You're The Storm ::

glcu - gentoo linux cron update (full featured semi-automatic updates via cron)
Back to top
View user's profile Send private message
RoadRunn
Apprentice
Apprentice


Joined: 10 Jun 2004
Posts: 162

PostPosted: Thu Aug 12, 2004 12:56 pm    Post subject: Include HostName Reply with quote

I'm setting up this script to run on my network updating 4 machines (of course via a local rsync mirror) and sending the emails to my mail server. I actually modified the script to put the host name of the computer in the subject of the email so I know which computer the script is reporting on.

[code]SUBJECT="glcu: New ebuilds for emerge $UPDATE on `/bin/hostname`"[/code][/code]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum