FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 02-02-2010, 01:30 PM
Tom Brown
 
Default Find and excluding directory

Hi

I have to use find to change the perms of a directory and files within
that directory recursively but i need to exclude a directory within the
top level directory, as its a netapp and so contains a read only
.snapshot dir.

I have tried...

# find /var/data/foo -path './.snapshot' -prune -o -exec chown
usera:groupb {} ;

but

chown: changing ownership of `/var/data/foo/.snapshot': Read-only file
system
chown: changing ownership of `/var/data/foo/.snapshot/hourly.0':
Read-only file system
chown: changing ownership of
`/var/data/foo/.snapshot/hourly.0/filename': Read-only file system

any clue ?

thanks
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-02-2010, 01:56 PM
Robert Nichols
 
Default Find and excluding directory

Tom Brown wrote:
> Hi
>
> I have to use find to change the perms of a directory and files within
> that directory recursively but i need to exclude a directory within the
> top level directory, as its a netapp and so contains a read only
> .snapshot dir.
>
> I have tried...
>
> # find /var/data/foo -path './.snapshot' -prune -o -exec chown
> usera:groupb {} ;
>
> but
>
> chown: changing ownership of `/var/data/foo/.snapshot': Read-only file
> system
> chown: changing ownership of `/var/data/foo/.snapshot/hourly.0':
> Read-only file system
> chown: changing ownership of
> `/var/data/foo/.snapshot/hourly.0/filename': Read-only file system

Your "-path" argument is wrong. Try this:

find /var/data/foo -path '/var/data/foo/.snapshot' -prune -o -exec chown
usera:groupb {} +

You need the whole path, and there is no need to escape the '.' character.
I've also used "+" as the terminator. That's just an efficiency issue. It
makes 'find' build command lines with as many matches as will fit rather
than invoking 'chown' separately for each one.

--
Bob Nichols "NOSPAM" is really part of my email address.
Do NOT delete it.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-02-2010, 08:17 PM
Tom Brown
 
Default Find and excluding directory

> Your "-path" argument is wrong. Try this:
>
> find /var/data/foo -path '/var/data/foo/.snapshot' -prune -o -exec chown
> usera:groupb {} +
>
> You need the whole path, and there is no need to escape the '.' character.
> I've also used "+" as the terminator. That's just an efficiency issue. It
> makes 'find' build command lines with as many matches as will fit rather
> than invoking 'chown' separately for each one.
>
>

Hi Robert

many thanks - that resolved ths issue for me

tom


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 10:39 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org