On Wednesday 30 November 2005 03:59 pm, A. Khattri wrote:
> We have servers (some Gentoo, some FreeBSD, etc) and we are currently
> using something called flexbackup to make backups that get pulled to a
> central storage server. flexbackup uses dump so it works at the partition
> level to make backups.
>
> My problem is this: flexbackup cannot be used to backup *part* of a
> filesystem - for example, it makes no sense to backup /usr/portage when
> making a backup of /usr.
>
> Im wondering if anyone has written a script (or maybe there's a tool to do
> this) that will make binary packages of everything installed on a server
> which can then be used to perform very quick restores in the event of a
> major failure?

If I understand you correctly, then this may help:
# obtain a list of installed packages
emerge -vep world | grep ^'\[ebuild ' | while read a; do
        # extract the package name
        pkg=$(echo $a | cut -d']' -f2 | awk '{print $1}')
        # build a binary of the package
        quickpkg "/var/db/pkg/${pkg}"
done

This should create binary packages of everything installed on your system (be 
warned that I have not tested this though).

As well, it may help to have:
FEATURES="buildpkg"
in your make.conf.  This way anytime a package is installed it will make a 
binary.

If you keep a backup of your /var/lib/portage/world file, it seems to me like 
you should be able to script installing all of the binaries on a new host.

I should also mention that gentoo catalyst may be worth looking into on the 
off chance that it may provide you with a solution.  You could build your 
very own stage and boot/rescue disk.  Here is a link to the project site:
http://www.gentoo.org/proj/en/releng/catalyst/


HTH,


Robert
-- 
[email protected] mailing list

Reply via email to