Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Nightly Emerge?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ThomasJ02
n00b
n00b


Joined: 27 Aug 2003
Posts: 38

PostPosted: Fri Dec 26, 2003 9:41 pm    Post subject: Nightly Emerge? Reply with quote

I have about 3 Gentoo boxes that I'd like to keep up to date with the latest versions of all installed programs. Is there anything wrong with just putting 'emerge -uUD world' in root's crontab?
Back to top
View user's profile Send private message
neuron
Advocate
Advocate


Joined: 28 May 2002
Posts: 2371

PostPosted: Fri Dec 26, 2003 10:30 pm    Post subject: Reply with quote

Code:

#!/bin/bash
#original script from cschwede on forums.gentoo.org
/usr/bin/emerge sync > /dev/null
upd=0
for i in ` /usr/bin/emerge -pUD world | grep ebuild | cut -f 2- -d "/" | cut -f
1 -d " " ` ;
do
        upd=1
        new_pkg=$(echo $i | cut -f 1 -d "-" )
        pkg="$pkg $new_pkg"
        if [ -f /usr/portage/packages/All/$i.tbz2 ]
        then echo "Binary package $i existing, but it's not installed."
        else echo "Binary package $i doen't exist, emerging... "; /usr/bin/nice
-n +19 /usr/bin/emerge -B =$i > /var/log/update.log
fi
done
if [ "$upd" -eq "1" ]
then
  echo Done.. to update system:
  echo emerge -k $pkg
  spaceused=$(du -h -s /usr/portage/distfiles | awk '{print $1}')
  spaceused2=$(du -h -s /usr/portage/packages | awk '{print $1}')
  echo Space used by distfiles : $spaceused, and packages $spaceused2
fi


this is the script I use, doesen't work great, but it's functional. (the mail it sends is sometimes a bit wrong, but it generates the right packages anyway)

note, this doesen't install anything, but compiles binary packages, so you can emerge -kDU world. And as you can see the original script is made by cschwede, I just added the mail stuff on the bottom.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
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