There's also --delete-before which 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 -z vs without it when I do my next dry run.
If I'm not mistaken, dry-run (-n) doesn't give you the results as it doesn't actually transfer nor compress data. It's only useful to verify that the command you'll testing will actually do what you want. For performance measurement you can use --progress and --stats.
Thanks! good to know. I'll keep that in mind.
You have your answers, but I just want to note that what I do is run rsync from cron nightly, without the delete option.
Basically this reduces the chances of losing something by accidentally deleting it on the primary drive. Every few weeks/months, I run the rsync command with the delete option to clean up.
It's not a perfect backup by any means, especially since I could erroneously delete something right before that second rsync command and lose it for good. But it does provide a measure of safety.
Thanks for sharing. I do something similar with the --delete option on an external drive in case I screw something up.
I do about the same, something like rsync -av --delete
Thanks for sharing! glad to see the --delete item being the key.
Same here. My local backups are rsync -av --delete
-z might be pointless since you’re transferring files locally.
I usually use rsync -azP --delete but I'm not sure if that's the best option.
Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0