Re: (sweet recovery!) when rpm --rebuilddb doesn't work! what next?

From: Michael Fratoni (mfratoni_at_tuxfan.homeip.net)
Date: 09/11/03

  • Next message: Marius Andreiana: "Re: php xslt for RH9 ???"
    To: redhat-list@redhat.com
    Date: Thu, 11 Sep 2003 00:02:03 -0400
    
    

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    On Wednesday 10 September 2003 11:05 pm, Didier Casse wrote:

    > Big thanks Michael! Your script is totally cool!!! I managed to rescue
    > some /var/logs/rpmkgs.3 file!

    You're quite welcome, glad you found it useful.

    > Then ran your script with the RH Cds and location of some other RPMS
    > that my friend downloaded and in less than an hour everything was
    > safely rescued.

    Excellent.

    > Lucky that you wrote such a a script. Out of curiosity, you wrote it
    > just out of the blue or you wrote it by necessity, i.e Did the disaster
    > happen to you or any of your clients/friends and thus decided to do
    > something about it?

    Actually, I wrote it in response to a posting on one of the Red Hat lists.
    Someone was trying to salvage a database, and asked how to do it.
    I moved the rpm database out of the way on a test machine, rebuilt it, and
    created a script of the commands I'd used.

    I've used it for a client or two since then as well.

    > Personally I think you should ask RH to include this in their next
    > distro release. :-) I went on Google and I realized a lot of people
    > make the mistake of wiping the /var/lib/rpm instead of the __db*!

    It's GPL, they know where to find it if they want to include it. ;)

    > I also find out that in SUSE Linux there's a time-stamped backups of
    > the RPM database in /var/adm/backup/rpmdb and that you can just copy it
    > to /var/lib/rpm, and everything gets back to normal! Anyway thanks a
    > lot!

    Hrmm, not a bad idea. Simple enough to accomplish via a cron job.
    You'd want to add some error checks and remove older backups, but
    basically this should work:

    #!/bin/bash
    newdir="/var/lib/rpmdb-$(date +%Y%m%d)"
    mkdir -p $newdir
    cp -a /var/lib/rpm/* $newdir
    chown -R rpm.rpm $newdir
    exit 0

    - --
    - -Michael

    pgp key: http://www.tuxfan.homeip.net:8080/gpgkey.txt
    Red Hat Linux 7.{2,3}|8.0|9 in 8M of RAM: http://www.rule-project.org/en/
    - --
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.0.7 (GNU/Linux)

    iD8DBQE/X/O7n/07WoAb/SsRAv52AKCRvNu+XaiY4AzkEXNQOhtZh0XGmwCdFW9M
    nhHNXCADsYj7O05YQaeZG+U=
    =YTpb
    -----END PGP SIGNATURE-----

    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: Marius Andreiana: "Re: php xslt for RH9 ???"