tech-userlevel archive

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

Re: Adding -l option to cp

On Fri, 28 Jan 2011 14:54:54 +0200
Antti Kantee <> wrote:
> Since the semantics of these kinds of options are not specified by 
> any standards, it is the committer's responsibilty to make sure 
> the exact semantics are available on the manual page.  In addition,
> the manpage should state what behaviour the option is expected to
> conform to, e.g. in this case:
>         The -l option is expected to behave similar to cp(1) in
>         GNU coreutils.
> This particular option (cp -l) is ok to commit after the manual is
> improved.

Thanks.  I changed the date in the manual to today and added the above
note.  I have just committed with these changes.

During the course of discussing this change I actually found a better
way to do the incremental backup.  While pax was suggested it has a
weakness (shared by cp -l) that it turns soft links into hard links in
the mirrored tree.  While this is not a problem (rsync will replace it
with the soft link from the directory being backed up) it is a bit
kludgey.  Joerg actually pointed me to a better way using rsync(1).
This has the additional benefit of doing both operations in one step.
Here is an example command that my script now generates.

rsync -aHz --delete --link-dest=/backup/20110205 /backup/TODAY

I considered not adding the option to cp(1) since there is another way
but there are still a lot of recipes out there that use it and I didn't
want people to say that NetBSD wasn't suitable for this type of
backup.  I may search out those sites and offer this improvement.

D'Arcy J.M. Cain <>

Home | Main Index | Thread Index | Old Index