Hi, Kelly Sauke wrote on 2011-07-01 09:21:28 -0500 [[BackupPC-users] Recompressing individual files in pool]: > I have a need to modify certain files from backups that I have in > BackupPC. My pool is compressed and I've found I can decompress single > files using BackupPC_zcat. I can then modify those files as needed, > however I cannot figure out how to re-compress those modified files to > be put back into the pool. Is there a tool available that can do that?
no. It's not a common requirement to be able to modify files in backups. Normally, a backup is intended to reflect the state a file system was in at the time the backup was taken, not the state the file system *should have* been in or the state *I'd like it* to have been in. I sure hope you have legitimate reasons for doing this. If you are modifying files, you'll need to think about several things. * Do you want to modify every occurrence of a specific content (i.e. all files in all backups linked to one pool file) or only specific files, while other files continue to contain the unmodified content? * If you are modifying every occurrence of a specific content, you'll either have to find out which files link to the pool file (hard, with a reasonably sized pool) or ensure you're updating the content without changing the inode (i.e. open the file for write, not delete and re-create it). If you do that, there is not much you can do for failure recovery. Your update had better succeed. * Does your update change the partial file md5sum? If so, you'll need to move the pool file to its new name and location. Presuming the new content already exists, you should probably create a hash collision. That may be less efficient than linking to the target pool file, but it should be legal (when the maximum link count is exceeded, a second pool file with identical content is created; later on the link count on the first file may drop due to expiring backups), and it's certainly simpler than finding all the files linked to your modified pool file and re-linking them to the pre-existing pool file. * If you're only changing individual files in a pc/ directory, the matter is far more simple. You'll need to take some code from the BackupPC sources for compressing anyway, so you might as well take the part that handles pooling as well (see BackupPC::PoolWrite and note that you'll be coding in Perl ;-). > Is there a better way to go about modifying certain files within my > backups? Once the contents you want to have in the files are in the pool (probably from a recent backup), you can just figure out the pool files and link to them. If you want that to be really easy, ask Jeffrey about his hpool directory ;-). Regards, Holger ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ BackupPC-users mailing list BackupPC-users@lists.sourceforge.net List: https://lists.sourceforge.net/lists/listinfo/backuppc-users Wiki: http://backuppc.wiki.sourceforge.net Project: http://backuppc.sourceforge.net/