<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p id="reply-intro">On 2021-03-09 21:29, Bruce Labitt wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div id="replybody1">
<div dir="ltr">A maybe not so smart rsync question...
<div><br />
<div>If one uses rsync -avz src/bar&nbsp; /disk2&nbsp; &nbsp; will that copy over everything from src/bar and create a directory bar on disk2?&nbsp; What if src/bar has other users or root?&nbsp; In other words, does the -a mean that it will preserve ownership and links and copy to /disk2?&nbsp; Just don't know if I need sudo or not.</div>
<div>&nbsp;</div>
<div>I dumbly did a copy.&nbsp; Well, that didn't preserve permissions or attributes.&nbsp; So deleting that...&nbsp; Since I'm trying to back up 100's of GB, thought I'd ask.&nbsp; This is taking a long time, even with USB3 drives and nvme.&nbsp;&nbsp;</div>
</div>
</div>
</div>
</blockquote>
<p>The '-a' flag is one of the few flags that actually means the same thing for both rsync and cp -- and does much the same thing, too.&nbsp; You should be able to use cp -av /src/bar /disk2 and have it copy attributes/permissions.&nbsp; You need the "sudo" in there to preserve ownership, as non-root can't assign other users' ownerships to the files.&nbsp; The main reason I might recommend "cp" over "rsync" is simply because I find "cp" a little less confusing -- what "rsync" does can vary depending on whether or not there are trailing slashes and so forth, and I never quite remember which is which.&nbsp; But the best thing about rsync is that if it barfs in the middle, you just up-arrow, and it starts over from where you left off.&nbsp; As with "cp", if you want the ownerships preserved, don't forget the "sudo".&nbsp; Note that unless you're transiting a network, I'd leave the "-z" off, because it'll just slow you down (substantially).</p>
<p>-Ken</p>

</body></html>