LWN.net Logo

CLI Magic: Simple backup is Mirdir (Linux.com)

CLI Magic: Simple backup is Mirdir (Linux.com)

Posted Nov 22, 2005 23:26 UTC (Tue) by hppnq (guest, #14462)
In reply to: CLI Magic: Simple backup is Mirdir (Linux.com) by tjw.org
Parent article: CLI Magic: Simple backup is Mirdir (Linux.com)

That is completely untrue. This command has everything to do with mirroring.

Nope, it has to do with archiving or moving data around, like you seem to observe yourself a few lines further on. Look up a definition of mirroring or hey, read the article! And yes, cp -a or -rp is the way to go of course. Consult the tar manpage for a hint of why this is a quick hack not suitable for mirroring, the synopsis should do it.

ssh somehost "cd /some/dir && tar czf -" | tar zxvf -

That makes more sense, yes. How exactly does it relate to mirdir?


(Log in to post comments)

CLI Magic: Simple backup is Mirdir (Linux.com)

Posted Nov 23, 2005 16:47 UTC (Wed) by tjw.org (guest, #20716) [Link]

Consult the tar manpage for a hint of why this is a quick hack not suitable for mirroring, the synopsis should do it.
Sorry, you'll have to be more specific. I don't see any reason why this is bad practice in the tar man or info pages.
Nope, it has to do with archiving or moving data around, like you seem to observe yourself a few lines further on. Look up a definition of mirroring or hey, read the article!

I did read the article.

I define mirroring a directory as "making an exact copy of the directory". A mirror copy, if you will. To me, this means that all files, permissions, ownership, timestamps, and special files like devices should be exactly the same in both copies.

That makes more sense, yes. How exactly does it relate to mirdir?

It relates to mirdir only because it's a different method of achieving the same end. While mirdir/mirrordir/rsync do some checking to eliminate unnecessary copying, cp or tar can be used to copy everything every time. My point was that there are cases when the latter method is preferrable.

CLI Magic: Simple backup is Mirdir (Linux.com)

Posted Nov 23, 2005 21:29 UTC (Wed) by hppnq (guest, #14462) [Link]

Sorry, you'll have to be more specific.

Metadata. Portability. See your definition of mirroring:

To me, this means that all files, permissions, ownership, timestamps, and special files like devices should be exactly the same in both copies.

You forget one quite important aspect: synchronization. This is what sets a mirror apart from an archive or a snapshot, for instance. Of course the concepts overlap: you can make an archive out of a mirror and the other way around.

It relates to mirdir only because it's a different method of achieving the same end.

Your tar | ssh | tar example served to illustrate a powerful variation of the original tar | tar example. But it has nothing to do with mirdir, which is entirely different, and explained in the article in a way that even a newbie can understand it.

Anyway, we're boring everybody's pants off, mine are in the laundry already. The point I wanted to make is: Joe wrote an article intended for newbies about making a simple local backup using a simple command -- and you take offence, because rsync appears to be a superior solution:

I seriously question the experience level of the person who writes the CLI Magic series.

I seriously question your reading abilities and your judgment. Like I said: I think articles like these are quite nice, because they help unleash some of the power that Linux offers to unexperienced users. And obviously you don't know Joe Barr.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds