On Wed, 19 May 2021 at 08:26, Steve Dondley <s...@dondley.com> wrote:
> I goofed up and accidentally moved my /usr directory while trying to > make room on a full drive. I was able to recover, but I'm finding that > services are not working because the sticky bits for many files > /usr/bin/* were lost. For example, I can't send email with exim because > of this error: > > Failed to create spool file /var/spool/exim4//input//1lj87g-0002tS-5J-D: > Permission denied > > Is there an easy way to ensure I set all the permissions back to where > they were before I move /usr? This is what I would do. Restore my backup somewhere so that I have a tree with the correct filesystem attributes. Make a temporary copy of the broken /usr tree to somewhere else, in case something goes wrong. Then run: sudo cp --attributes-only --archive /correct/* /broken I tested this just now on a toy example, it seems to work. I suggest to test it yourself before using it, to verify that it does what you need.