Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
automating fixpackages question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
deque
n00b
n00b


Joined: 28 Apr 2003
Posts: 53

PostPosted: Tue Jun 17, 2003 4:18 pm    Post subject: automating fixpackages question Reply with quote

I am running a group of several servers who share a common portage tree via NFS. They all are almost identical in terms of hardware, so I have them build binary packages to save time when I need to install the same package on another machine. This leads to fixpackage taking a very long time to run. In order to keep everything updated and clean, I wrote a little script which runs emerge sync and fixpackages on the server that hosts the portage tree:
Code:

#!/bin/bash
host=`cat /etc/hostname`

echo Updating portage on $host ...
echo
/usr/bin/emerge sync > /dev/null
if [ "$?" -eq 0 ]
then
  echo Portage update on $host successful!
else
  echo Portage update on $host failed! Please login to $host and find out why!
fi

echo
echo Fixing Packages on $host...
/usr/bin/fixpackages > /dev/null
if [ "$?" -eq 0 ]
then
  echo Package Fix on $host successful!
else
  echo Package Fix on $host failed! Please login to $host and find out why!
fi



I run this with a crontab entry:
Code:

0 0 */2 * *     sh /root/syncit.sh | mail -s "Portage Sync Results" root


The problem I am having is that fixpackages seems to output it's progress information to STDERR instead of STDOUT, so I get spammed by cron with all of the progress information in addition to the email I want to get. I know I can also pipe STDERR to null, but then wouldn't that break my little error checking routine in my script? I know there must be a way around this, but I can't think of it. Any advice would be appreciated.

-thanks and regards-

-Deque-
Back to top
View user's profile Send private message
Tiganu
Tux's lil' helper
Tux's lil' helper


Joined: 02 Oct 2002
Posts: 105
Location: Montreal

PostPosted: Tue Jun 17, 2003 4:33 pm    Post subject: Reply with quote

Mabe test the return value of /usr/bin/fixpackages instead of the STDERR.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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