[ubuntu-uk] rsync chgrp problem - advice, please?

Neil Greenwood neil.greenwood.lug at gmail.com
Thu Jun 7 21:42:26 BST 2007

On 07/06/07, luxxius <luxxius at googlemail.com> wrote:
> It seems that after running
> find ~/music -group diana -exec chgrp root {} \; -exec chmod 664 {} \;

This is where the problem with the 'vanishing' directories started...
(of course, hindsight is wonderful, isn't it!)
The command should have been
find ~/music -type f -group diana -exec sudo chgrp root {} \; -exec
sudo chmod 664 {} \;
(not sure if sudo is needed on the chmod command though)

This would have left the directories as-is, and just changed the
files. The quick command to fix the broken directories would have been
find ~/music -type d -exec sudo chmod 775 {} \;
find ~/music -type d -print0 | xargs -0 sudo chmod 775
(again, not sure if the sudo is needed)

> I lost all access to the files in my music directory and subdirectories,
> to scary extent that Nautilus had no information about the directories
> or files - their sizes, permissions, type:  all vanished! And I could
> not 'sudo cd' to any of the directories - no permission (?!)

The reason that the directories 'vanished' is that execute permission
is used to indicate that directories can be browsed i.e. listed in ls
or Nautilus. When you did the chmod 664 it also worked on the
directories, and then you couldn't look into them.

> But if I did sudo su, I could ls the contents of directories and see the
> file details with ls -lah.

Root ignores the execute permission when you do the ls command. You
could also probably have seen them with a sudo ls (not tested though).

Glad you've fixed it all. As Popey suggested, just ignore the warnings
in future!


More information about the ubuntu-uk mailing list