I wanted a sanity check on my current rsync flags. Posts on Reddit seem to highlight the use of rsync -avz for most use cases, for some instances even for when someone asks for mirroring a drive: https://www.reddit.com/r/DataHoarder/comments/rau071/rsync_command_to_mirror_drive/. This has not worked for me for the following case:
Drive #1:
file1.txt
file2.txt
Drive #2:
file1.txt
file2.txt
file3.txt
With -avz, file3 on the destination would not be deleted. With experimenting, I ended up now using rsync -havziP --delete-after --info=progress2 dir1/ dir2/, which actually ended up mirroring the drives for me. My question is: is this the best rsync approach for mirroring drives or was there a better option that works better?
Side note: it is interesting that rclone sync from rclone (https://rclone.org/commands/rclone_sync/) claims to delete by default, while with rsync it seems to be something you have to distinctly mention.
I usually use rsync -azP --delete but I’m not sure if that’s the best option.
There’s also
--delete-beforewhich might help if your destination is tight on available space. And, as usual with ‘traditional’ tools, man-page is pretty good, there’s a ton of parameters which might be helpful. And, as @hades@feddit.uk already mentioned, compression (-z) may actually hurt performance if you have a lot of bandwidth or if you’re copying over already compressed data like JPGs.I wasn’t aware of the full impact of
-z. Thanks for clarifying that for me (thanks to @hades@feddit.uk as well!). I’ll definitely keep an eye on the speed with-zvs without it when I do my next dry run.
-zmight be pointless since you’re transferring files locally.I do about the same, something like rsync -av --delete
Same here. My local backups are rsync -av --delete
Thanks for sharing! glad to see the
--deleteitem being the key.
Grsync makes this easier :)
never used it what is different/better to rsync?
Graphic interface, you just click options. And it has drop downs for favourite folders you’ve configured before so you can switch between backup/sync locations.
Once you apply, it runs rsync, and it it shows you the CLI command used as visual reference





