[Samba] File permissions

Greg Freemyer freemyer at NorcrossGroup.com
Tue Aug 20 08:18:01 GMT 2002


Joel,

Welcome to the nasty world of backups.  Everyone thinks of them as being a =
simple thing to control, but in reality they are pretty difficult.  I have read =
that 50% of all backups have corrupted data on them for exactly the reasons you =
are mentioning. :<

I had a Server backup fail for this reason at a Major Fortune 500 company a few =
months ago, and the group I was supporting was paying the internal backup team =
thousands of dollars a month to do the backups.  :<  They were supposed to be =
backup specialists, but were ignoring errors about open files!!!!

Anyway, the standard *NIX statement is that it is the admins job to queise the =
system prior to performing the backup.  i.e. Make sure there are no open files.

Traditionally a backup window is defined each night.  Then all the server apps =
are shutdown, backups performed, apps restarted.

Some zealous admins use the fuser command to kill any remaining processes using =
a filesystem just prior to backing it up.  Then unmount the FS and re-mount it =
read-only for the duration of the backup.

Obviously, today's 7x24 operations cannot handle the multiple hour backup =
windows this requires, so a lot of enterprise class apps have added the ability =
to accept a queise command, you to your backup, then let them go again.

i.e. Oracle does this for sure, but I think a lot of others do it as well.

SInce this is for a 7x24 operation, it is your job to do the backup and get the =
app running again in just a few seconds as opposed to the multiple hours it =
normally takes.

This is where snapshots and clones come into play.  Either one can create a =
read-only FS image in just a few seconds.  Then you mount and backup the image =
at your leisure.

You mentioned Linux I think, and Linux supports LVM from Sistina which supports =
snapshots.  (In theory anyway, I'm trying to get them to work as we speak, and =
they seem broken to me.)

Other *NIX have other software to do this, and most external raid arrays =
support snapshots and clones in hardware.

HTH

Greg Freemyer
Internet Engineer
Deployment and Integration Specialist
Compaq ASE - Tru64 v4, v5
Compaq Master ASE - SAN Architect
The Norcross Group
www.NorcrossGroup.com


 >>  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.=20
 >>  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.
 >>  >=20
 >>  > > -----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
 >>  > >=20
 >>  > >=20
 >>  > > I would be surprised if linux would be so impolite as to=20
 >>  > > 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.=20
 >>  > > Have the cron job
 >>  > > run every second and start saving some big files. Or, you=20
 >>  > > 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=20
 >>  > > file is done
 >>  > > > being written before you move it?  You might get unlucky=20
 >>  > > and move half a
 >>  > > > file.
 >>  > > >=20
 >>  > > > > -----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
 >>  > > > >=20
 >>  > > > >=20
 >>  > > > > Another approach.=20
 >>  > > > >=20
 >>  > > > > If what you are doing is getting the kids to send in school=20
 >>  > > > > assignments via
 >>  > > > > the share, why not write a cron job which monitors that=20
 >>  > > > > share, say ever 5
 >>  > > > > secs, and when a file appears on the share, it is removed=20
 >>  > > and stored
 >>  > > > > somewhere else.
 >>  > >=20
 >>  --=20
 >>  To unsubscribe from this list go to the following URL and read the
 >>  instructions:  http://lists.samba.org/mailman/listinfo/samba







More information about the samba mailing list