Re: Create a catalog from the rpm database
Denis Corbin <[email protected]> Tue, 28 Jan 2014 22:36:48 +0100
| Newsgroups | gmane.comp.sysutils.backup.dar.general |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Le 27/01/2014 22:31, gulikoza wrote: [...] >> I think it *does* make sens. While OK, I am not sure to have very >> deeply > understood your script but that's because I'm not yet python-ready > ;-) > > The python script creates the root filesystem of the server in > /dev/shm from the information in the rpm database. The files > obviously have no content, but size, timestamp and permissions > match those of what the real filesystem should have if it's not > modified (it will take into account prelinking: it checks the > checksum of the real file with prelinking reversed, compares it > with the checksum stored in rpm database and if it matches it'll > create the "fake" file with prelinked size so it matches real file > size; prelinking check is taken form yum code so it works similarly > to what yum verify and rpm -V do with prelinked binaries). > > A dar snapshot backup can then be taken on the "fake" root in > /dev/shm followed immediately by a diff backup of the real root > against the snapshot. Only files which really differ from currently > installed set of rpm packages are considered since all the > comparison fields dar uses should match (if not, the file should be > backed up anyway). This way, the base (the reference) archive is > generated from the system package manager, while dar and its logic > is used to determine which files actually end up in the archive. My > initial idea was to add something like '-A rpmdb' (rpmdb not being > an archive with this name, but to use the system rpm database as a > "meta-reference" archive) to dar itself, if you know what I mean, > but I felt like I could test the concept faster with a separate > script :-) OK things get much clearer now :). I understand that you want to compare the expected filesystem as described by the rpm database to the real filesystem, and save thoses file out of the rpm base or those modified since a the corresponding package has been installed. The script method is, I thing, the best approach as it does not put any dependency between libdar and rpm tools, thus brings a robust solution against changes in libdar and changes in rpm tools. It has however the drawback to need creating a faked directory tree (using sparse files as you described). Another way would be to have libdar be rpm aware or have rpm tool able to generate a dar snapshot backup, it's not evident it would be faster and it would be complicated to maintain. Last another way would be to extend libdar API to let an application specifying the contents to be used to generate a snapshot backup, such application would also be rpm aware and could replace your script without the drawback of creating temporary files ... well, so far, I could not find any API simple enough to be easily useable... If you want, I can add your script with other existing ones in dar documentation ( http://dar.linux.free.fr/doc/samples/index.html ). Else I can also add a link in external tools toward an URL where you could maintain and keep up to date your script eventually adding features, and so on. > > Regards, gulikoza > Regards, Denis. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIVAwUBUugi8AgxsL0D2LGCAQIHSg//YlWAYDiUrqPGbKtiQcIAyKy6ySD4nx98 oIZPYtyjmpn44U6K0n4bz/W19ARbh0r4uqpXRM3GgNVWHkU/kY7UlEUSVH0hqh3A tCLooszJ8zmcinim4ajYLt/s/0kIAKUeQOlmHpIHxcdPuAGSP3t8RpqMmK3Zsb5E fiyY35xDlWmgrtfHxe9nmshTv4p4yPayR2KCzXpz+J5pG2pf8v1h/sQdP6uPhPLX p8odVyQQXOjQ+HCvYHaweVvXR6xINt99Bh5YUuuSbS1Mw2OiPrxrE23cj8oB6pU8 XEVSOGSssPdJSmxXrqKAt36jiLK29INwRM3aB+3C4UxlpEdmExRPL2e6ScKbAVmK JRTKyR4QMDojIPeVHLNpDUQ45ehTexOB7OF9stIA693M/FQRlKNJNX8EQizC7ou3 LwD1rwq6vrsu04QgFxgqW/lOqn1xb0JjOgl4c5LNn1k6uTGHvXvOXpaoue6mnS+f wsD7AEqxLOZDgosjO7zEEoljlylOVjsu4/z6AQIxV7Jug6kFphhrcJJuO9mMrhhC xa//jiGtGvRgt/V5+e3SHlvfREnGGggScsVvMsb8hbg0lCrowJ3b7nYEVjkmrkPu DOXOVJ+qoA0JgFhtfSXqtBRAiMTKL5Oa+KKGohIDy7nqY+G1YWD3iClu98D1rcDY vUdLDHVguCM= =ktDA -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ WatchGuard Dimension instantly turns raw network data into actionable security intelligence. It gives you real-time visual feedback on key security issues and trends. Skip the complicated setup - simply import a virtual appliance and go from zero to informed in seconds. http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk