8

I have mirrored 100 GiB of files. On my mirror, some of the timestamps and maybe file permissions are wrong. I would like to use rsync to fix this.

The server from which I have downloaded has more than 100 GiB of files. My mirror mirrors certain files from each source directory. It does not mirror whole directories.

How can I tell rsync to fix my timestamps and file permissions, without redownloading 100 GiB?

For information, I am now trying rsync -av --list-only HOST::MODULE >/tmp/list.txt. Once I have fetched this data, if none of you can tell me a better answer, I will write a script to touch each of my files based on the data.

But is there no neater way to do the job?

(There is this question, but it does not seem to answer what I need.)

1 Answer 1

13

If your source and destination are on separate systems, with an rsync client talking to an rsync server (of any sort), then the permissions and timestamps will be updated without a data content transfer. For example:

rsync -avP --existing server:/path/to/source /path/to/target
rsync -avP --existing server::module /path/to/target

On the other hand, if your source and destination are managed by the same single rsync process, such as when the server's filesystem is accessible via NFS, then there is no efficient way it can confirm that the data is the same in both cases so it abandons its shortcuts and simply recopies the data with the corrected permissions and timestamps. For example:

rsync -avP --existing /path/to/server/source /path/to/target

If you have this second scenario and you are absolutely certain that the file contents are identical, there is a workaround that will force rsync to assume the content is the same - even though its "quick check" fails - and just update the permissions and timestamp:

rsync -avP --existing --size-only /path/to/server/source /path/to/target

The --existing flag ensures that no new files are created in the target location, but that existing files are updated appropriately. The --size-only flag forces rsync to ignore timestamps.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .