Some thoughts on enhancing cpio(1)

Henry Spencer henry at utzoo.UUCP
Wed May 14 04:12:12 AEST 1986


> > ... dump based on the most recent of the mod time and the change time...
> 
> The change time (ctime) is always set to the present when the modification
> time (mtime) is altered. Hence, it is sufficient to look at only the change
> time.

This is true if you are positive that all Unixes and Unixoids and Unixish
systems will get this fine point right.  It costs little to be paranoid
and check both, which is presumably why the V7 dump does it that way.

> Also, the rename problem is deeper than inferred; what about all of
> the file pathnames which change when a directory is renamed?

With the old-style dump/restor approach, this is a null issue.  When you
restore the parent directory, which changed when its child was renamed,
it has a link to the child under the new name.  Hence the child is known
by the new name and its files and subdirectories are available via the
new path.  It is sufficient to note that their names have changed; it is
not necessary to dump them again.

> It is reasonable to back up active filesystems with this scheme. Races with
> users generally result in doubly backed up files or innocuous "cannot open"
> messages. Only an unlikely combination of renamed directories and files with
> identical inode change times appear likely to break this algorithm.

For most ordinary Unix purposes, this algorithm should be reliable.
There is, however, a more subtle problem which can arise.  Things like
database systems may well be in an inconsistent state when backed up.
There can be race conditions even if all relevant files appear to change
simultaneously,	since the backup algorithm does not process them
simultaneously.  The only way to produce a backup tape which is an exact
snapshot of the system is to require everybody to hold still while you take
the snapshot.  (It is admitted that backups which are not exact snapshots
may still be a useful form of backup.)
-- 
Join STRAW: the Society To	Henry Spencer @ U of Toronto Zoology
Revile Ada Wholeheartedly	{allegra,ihnp4,decvax,pyramid}!utzoo!henry



More information about the Net.bugs.usg mailing list