3

I have executed following command in order to get the list of files that would be transferred to remote server if rsync is executed:

rsync -avzm --stats --safe-links --ignore-existing --dry-run --human-readable /tmp/test REMOTE-HOST:/tmp/data/ >> /tmp/transfer.log

In order to fetch only the list of files (all are PDFs), I executed following command:

grep 'pdf$' transfer.log > files.txt

Where I could not see the absolute paths of the files:

test/2103/0E/210321449902_NR_1/210321449902-1-A4-NB.pdf
test/2103/0E/210321481320_NR_1/210321481320.AKPML.pdf
test/2103/0E/210321779915_NR_1/210321779915-1-A4-NB.pdf
test/2103/0E/210321959975_NR_1/210321959975-01-A4-NB.pdf

What option should be used in order to get absolute paths of the files when rsync dry-run is performed?

I need to use that list of files so that I can cat the file list and execute multiple rsyncs using GNU parallel. (as in THIS question)

Mandar Shinde
  • 3,156
  • 11
  • 39
  • 58
  • 1
    Use the `-R` or `--relative` option. – fd0 Apr 10 '15 at 11:28
  • 1
    Odd that one has to specify `--relative` to get absolute paths, but it works. Suggest you post it as an answer, @fd0. – Jim L. Apr 05 '19 at 21:23
  • `-R` is a really bad idea in general. It (fundamentally) changes the *behaviour* of rsync, not the reporting. – EML Sep 23 '22 at 09:15

0 Answers0