deque n00b
Joined: 28 Apr 2003 Posts: 53
|
Posted: Tue Jun 17, 2003 4:18 pm Post subject: automating fixpackages question |
|
|
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- |
|