[Samba] File permissions

Joel Hammer Joel at HammersHome.com
Tue Aug 20 07:27:00 GMT 2002


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.
> > 



More information about the samba mailing list