Accidentally changed group at root level
I believe i messed things up and would greatly appreciate some input…
I wanted to change group on a directory in public_html but instead ran the command at root level, recursively of course. I got a few "Operation not permitted" errors, but most files and directories now has the group www-data.
This is the command that was executed:
# chgrp -R www-data /srv/www/example.com/public_html/media *
Is this a FUBAR situation, ie start from scratch or can I rectify this somehow by setting the group to root recursively or something?
Thanks,
7 Replies
backup# find / -xdev -printf "chgrp %g %p\n" > /tmp/doh.sh
Copy /tmp/doh.sh over to your broken node and:
failboat# sh /tmp/doh.sh
It should get most everything. You'll want to check for the stragglers with:
failboat# find / -xdev -group www-data
If you don't have a backup, you're FUBAR.
@hoopycat:
backup# find / -xdev -printf "chgrp %g %p\n" > /tmp/doh.sh
That is an amazing trick, very cool, will have to remember that.
That I used the root account was a correct assumption by the way.
Anyways, thanks again. I am sure I will have reasons to come back to the forums, which I have actually followed since I sign up. Despite the setback I am really happy with Linode and the service. Everything went really smooth up until yesterday.
Cheers