bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

chown: say will write only if something needs to be changed


From: Dan Jacobson
Subject: chown: say will write only if something needs to be changed
Date: Mon, 18 Apr 2005 05:13:16 +0800

Please mention in the chown documentation when and if always, chown
will only write to the disk if something needs to be changed!

--- Begin Message --- Subject: Re: Bug#304253: wwwoffle: only chown files that need it Date: Wed, 13 Apr 2005 11:25:14 +0200
On Tue 12 Apr 2005, Dan Jacobson wrote:
> 
> Instead of
>   nohup chown -R proxy:proxy /var/cache/wwwoffle....
> Perhaps only change the files that need it:
> 
> cd /var/cache/wwwoffle #makes shorter xargs list
> p=proxy
> find /var/lib/wwwoffle/ . ! \( -user $p -group $p \)| 
> xargs --no-run-if-empty chown $p:$p
> 
> That way folks' backup schemes wouldn't get fooled into thinking those
> files need to get backed up again due to changes.

If those files are in fact changed by the chown, then it was necessary,
and doing an intermediate find step will only cost more performance.
Demonstration:

address@hidden:/tmp$ stat /tmp/wwwoffle.conf.diff
  File: `/tmp/wwwoffle.conf.diff'
  Size: 265             Blocks: 8          IO Block: 131072 regular file
Device: 302h/770d       Inode: 127282      Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1214/    paul)   Gid: (   50/   staff)
Access: 2004-12-08 16:32:03.000000000 +0100
Modify: 2004-12-08 16:31:50.000000000 +0100
Change: 2004-12-08 16:31:58.000000000 +0100

address@hidden:/tmp$ date
Wed Apr 13 11:24:58 CEST 2005

address@hidden:/tmp$ chown paul:staff wwwoffle.conf.diff

address@hidden:/tmp$ stat /tmp/wwwoffle.conf.diff
  File: `/tmp/wwwoffle.conf.diff'
  Size: 265             Blocks: 8          IO Block: 131072 regular file
Device: 302h/770d       Inode: 127282      Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1214/    paul)   Gid: (   50/   staff)
Access: 2004-12-08 16:32:03.000000000 +0100
Modify: 2004-12-08 16:31:50.000000000 +0100
Change: 2004-12-08 16:31:58.000000000 +0100


I don't see that any attribute of the file has changed; if a backup
scheme *does* see a change, then that backup scheme is at fault and your
proposed "fix" won't serve any purpose.


Paul Slootman


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]