Comments (4)
On other file-systems, you may still wish to compress file contents when rsync'ing for backup, copying to a mobile drive etc. You could do this using --copy-cmd and gzip (or xz or similar) to compress destination files, like-so:
Hmm… Let's have a big file (e.x. 4Gb) on the server.
- Client runs
rync server:bigfile .
;
sent 43 bytes received 4,296,015,958 bytes 8,635,208.04 bytes/sec
total size is 4,294,967,296 speedup is 1.00
- Some changes on the server occurs;
dd if=/dev/urandom of=bigfile bs=1k count=1 seek=1000000 conv=notrunc
- Client runs
rync server:bigfile .
again. Only changes (and checksums) are transferred.
sent 524,363 bytes received 327,794 bytes 28,886.68 bytes/sec
total size is 4,294,967,296 speedup is 5,040.11
IMO such rsync behavior is incompatible with your proposal.
from rsync.
I'm not sure what you're trying to demonstrate here?
One of my opening lines is:
When provided, instead of copying a file using the default method (delta transfer), rsync will instead use the provided custom command.
The trade off for using the custom command is that rsync can't do checksum based transfers, but you're still gaining the full benefits of rsync's various features for finding changed files (by timestamp, and optionally size if you know it should be the same), plus filtering of transfer lists etc.
You would (and should) only use a custom copy command in cases where the benefits of doing so are well known to be better than relying on rsync's checksummed transfer algorithm, i.e- you know that changed files will need to be copied (or cloned) in their entirety.
But there are plenty of cases where the copy command itself will lack a lot of rsync's flexibility; cp
as I've used in these examples doesn't have any of the finding/filtering/comparison options that rsync does, and nor do compression tools.
There could be an argument for an intermediate transfer option, e.g- for compression, the command is used to generate a file locally for transfer, so the per-block comparison can still occur with a previously compressed version of the file, but this would need to be an additional option as it won't be suitable for every command.
from rsync.
Just so you know, this is fairly unlikely to be implemented. It would likely be limited to local copies only, so if I ever get around to doing some big changes to rsync's local copying workflow then I will be considering this idea as an additional feature.
from rsync.
I appreciate any consideration of this; I should stress, not all options are required, I have a tendency to overthink stuff like this, and the ability to do this with remote transfers is always something that can be done later.
In terms of local transfers the only changes that are required are:
--copy-cmd
to take the command, once a file is identified for transfer this is executed in place of normal behaviour, disables comparison of files by size by default.--copy-cmd-size
to re-enable comparison by size when the copy command should preserve it.
Warnings for incompatible options (--append
and --inplace
) might be appropriate, but they're not required as the use of the copy command would bypass them anyway.
from rsync.
Related Issues (20)
- feature: automatically include leading folders for --include-from entries: ****
- --dry-run makes --itemize-changes miss files in log-file
- memory allocation errors - likely cause found. HOT 1
- Hidden attribute is set in copying readonly files to a Samba server
- rsync 3.3.0 still crashes with "*** buffer overflow detected ***: terminated" HOT 11
- detect renamed files and avoid file transfer HOT 1
- Filter is dependent on alphabetical order of source dir names
- encrypt destination files with gpg
- Enhancement: Do rsync file list in reverse order (or newest files first)
- Slow transfer after resume
- Documentation: Add references for "undocumented" exit codes 124 - 127 in errcode.h and extend the exit codes in man page
- Destination symlink will be deleted before data transfer start
- Trivial: Delete branch named "b3.0.x"
- [Feature request] Add a inline progress
- directory permissions set too early when copying read-only directory with -r
- rsync 3.2.7 client fails "rejecting unrequested file-list name" talking to rsync 3.2.7 (and ealier) server. HOT 3
- missing dependencies for the precompiled binary?
- files where copies instead of linked to destination directora
- header_major_fixed.m4 is a bad idea
- Rsync does not map UID for POSIX ACL entries where USER = FILE OWNER HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rsync.