Re: Create a catalog from the rpm database
"gulikoza" <[email protected]> Mon, 27 Jan 2014 22:31:24 +0100
| Newsgroups | gmane.comp.sysutils.backup.dar.general |
|---|---|
| Message-ID | <[email protected]> |
> Do you mean that the system backups take place inside the content backup? Not sure to understand (... sorry its late here :@) ) > > to have the history of changes you might be using dar_manager, unless I don't exactly what you need to do... Yeah, sorry I was perhaps a bit unclear. The content backup usually has a designated backup location (might it be NAS or some other place) and is rotated according to the backup policy. System backups I make manually so that I can inspect the changes on the system itself, I also archive them indefinitely and separately, not on the usual backup location so that I have a collection of all system backups (even if the server was retired and migrated to newer hardware/system...). > Yes, I've noted that upgrading a package (.deb or .rpm) often reinstall 90% of the file concerned by that package ... which dar detects as changed and save them > again. You can eventually ignore some attributes modifications, like permission or ownership while the file size is the same [--comparison-field option] but at the > risk you miss some updated files... Well, a decent upgrade from let's say Centos 6.4 to Centos 6.5 will update a big portion of the stored files, making diff almost as big as a full system archive... > Another possibility would be to upgrade a reference server with packaging tools and take differential backup of it with dar that you push to other servers, no? Yes, that's exactly what I started doing, but unfortunately servers differ to much in services to be able to have a truly useful reference archive. For instance having Dell OMSA tools installed adds a lot to the system, but a non-Dell server does not have that. Some servers have web services, others mail/spamassassin, samba, etc... I tried creating a base archive with the most common packages, but diff was still large. And updating a minor version of kernel or OMSA tools can easily add 100s MB to the backup, so you need to update the reference each time or live with the added files in each diff... > 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 :-) Regards, gulikoza ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk