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

Matthew Macdonald-Wallace matthew at truthisfreedom.org.uk
Thu Jun 7 07:24:48 BST 2007


On Thu, 07 Jun 2007 07:02:06 +0100, luxxius <luxxius at googlemail.com> wrote:
> Neil Greenwood wrote:
> <snip>
>> check the group for the files that gave errors and one
>> of the files that didn't. Change the problem files to be in the group
>> that isn't causing problems.
> 
> I can find all the files with the group that's causing the hiccup using
> 
> 	find /home/diana/music -group diana
> 
> Is there a simple way to redirect the results to chgrp root and then
> chmod them to 664 so that I can automate this in future?
> 
> (I've been trying, without success, to pipe the find results, but I'm
> struggling now.  Books are fine for individual commands, but not much
> help for creating processes or very simple scripts)
> 
> TIA
> --
> Diana


Try (and this may need checking by others!)

for i in find /home/diana/music -group diana; do chgrp root $i && chmod 644 $i; done

basically (if I've got it right!) then this loops through the output of the find command and executes chgrp and chmod on every line that is sent to it.

Cheers,

Matt.




More information about the ubuntu-uk mailing list