[Samba] File permissions

Goetz Rieger goetz.rieger at suse.de
Wed Aug 21 00:56:01 GMT 2002


Hi,

On Tue, 20 Aug 2002 12:26:14 -0400
Joel Hammer <Joel at HammersHome.com> wrote:

wow, you are really getting in to it?

Ok, after some discussion here my opinions ;-):

mv don´t changes the inode-number, just the entry in the directory. So a
writing process should be able to write an already opened file further
after another process has mv´ed the file.

cp will copy a file, which is at the "same" time written to, until it
finds the EOF. When the writing task is getting active again, it could
write EOF somewhere else, but the cp´ing process thinks it has
finished....

Hope I got this right...
Goetz

> This really has me flabbergasted.
> cp doesn't seem to care.
> I just tried tar, and it happily tarred an open file, or at least a file
> that was being writen to with a piping command.
> So, how is wholesale file corruption avoided when using tar as a backup
> program or mv'ing or cp'ing directories as a backup tool?
> Joel
> On Tue, Aug 20, 2002 at 12:03:40PM -0400, David Brodbeck wrote:
> > Most Linux utilities have no real concept of file locking.  I think cp
> > will quite happily copy a file that's in the process of being written
> > to.  I'm not sure what'd happen if you tried to mv or rm it.  mv might
> > be okay, as long as it was to the same filesystem, since the inode
> > would stay the same.
> > 
> > > -----Original Message-----
> > > From: Joel Hammer [mailto:Joel at HammersHome.com]
> > > Sent: Tuesday, August 20, 2002 11:59 AM
> > > To: David Brodbeck; samba at lists.samba.org
> > > Subject: Re: [Samba] File permissions
> > > 
> > > 
> > > I would be surprised if linux would be so impolite as to 
> > > attempt to move a
> > > file that was being writen to. Would cp or rm be so badly behaved?
> > > But, I get surprised everyday.
> > > I guess the only way to be sure is to try it out and see. 
> > > Have the cron job
> > > run every second and start saving some big files. Or, you 
> > > might use smbstatus to
> > > make sure the file wasn't in use before acting on it.
> > > Joel
> > > On Tue, Aug 20, 2002 at 11:27:42AM -0400, David Brodbeck wrote:
> > > > One problem I see with this approach is how do you know the 
> > > file is done
> > > > being written before you move it?  You might get unlucky 
> > > and move half a
> > > > file.
> > > > 
> > > > > -----Original Message-----
> > > > > From: Joel Hammer [mailto:Joel at HammersHome.com]
> > > > > Sent: Tuesday, August 20, 2002 10:35 AM
> > > > > To: Scott Mayo; samba at lists.samba.org
> > > > > Subject: Re: [Samba] File permissions
> > > > > 
> > > > > 
> > > > > Another approach. 
> > > > > 
> > > > > If what you are doing is getting the kids to send in school 
> > > > > assignments via
> > > > > the share, why not write a cron job which monitors that 
> > > > > share, say ever 5
> > > > > secs, and when a file appears on the share, it is removed 
> > > and stored
> > > > > somewhere else.
> > > 
> -- 
> To unsubscribe from this list go to the following URL and read the
> instructions:  http://lists.samba.org/mailman/listinfo/samba


-- 
Goetz Rieger
SuSE Linux AG                                 Professional Services
Geschaeftsstelle Rhein-Ruhr                   Phone: +49 2241 92917-39
Marie-Curie-Str. 11-17, D-53757 St. Augustin  Fax:   +49 2241 314599



More information about the samba mailing list