> Hi > I have a requirement that, if my RPM package is overwriting a file(any > file, not only config) from another package, take the backup of that file. > Basically I want to do something like the following in the %pre section > > %files -p $location/files.txt > %pre > tar -cf /opt/changedfiles.tar %{files} > > But this is not working as it is. On Tue, 31 Aug 2004, Sateesh wrote: Would be better to scan the files payload of all the rpms that your are going to install/upgrade and then see if they overwrite any files. Those files backup. That said, if your requirements are loose enough that you only need to backup all the files that are owned by each rpm being upgraded, then in that case throw --repackage on the command line (or better yet configure rpm to repackage all erasures, by adding the following to your /etc/rpm/macros file (create it if it does not exist): # # If non-zero, all erasures will be automagically repackaged. # We want all erasures to be repackaged. %_repackage_all_erasures 1 If you take the time before you started the upgrade then you can do: rpm -Uvh --rollback "$TBeforeUpgrade" to roll this back, or you can re-install the repackaged package but you have to throw the --nodigest switch: rpm -Uvh --nodigest --oldpackage repackaged.rpm Cheers...james _______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/rpm-list