1

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)

  • 1
    Use the -R or --relative option. – fd0 Apr 10 '15 at 11:28
  • 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 5 at 21:23

Your Answer

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

Browse other questions tagged or ask your own question.