Is there a way for rsync to copy a set of files without copying their data, much in the same way that cp --attributes-only does?

I'm asking because I'd like "preview" metadata about a set files that were previously backed up with rsync using archive (-a) and fake-super (-M--fake-super) modes (which stored metadata and true owners in extended attributes), without needing to take the time or space to copy the file contents back before examining their metadata and true owners.

1 Answer 1


Normally rsync relies on timestamps and file-sizes when copying to a remote site, but compares file contents for local files. You can modify this behavior using --ignore-times and --ignore-size.

If you repeat the -v (verbose) option, it adds details on the files which are copied. To preview, use the -n (no-op or "dry-run") option.

Repeating -v 4 times shows the meta data (for Debian, using rsync 3.0.9-4).

Here's a part of the output from a dry-run:

[sender] make_file(imsg.c,*,2)
[sender] make_file(vis.h,*,2)
[sender] make_file(fgetln.c,*,2)
[sender] make_file(fparseln.c,*,2)
[sender] make_file(openat.c,*,2)
[sender] flist start=1, used=28, low=0, high=27
[sender] i=1 /tmp/tmux-2.1/compat ./ mode=040755 len=4096 uid=1001 gid=100 flags=5
[sender] i=2 /tmp/tmux-2.1/compat asprintf.c mode=0100644 len=1465 uid=1001 gid=100 flags=0
[sender] i=3 /tmp/tmux-2.1/compat b64_ntop.c mode=0100644 len=7418 uid=1001 gid=100 flags=0

The first part of that is shown at 3 -v options.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.