Here's an example of the command I'm using:
rsync --list-only --include "*2012*.xml" -exclude "*.xml" serveripaddress::pt/dir/files/ --port=111 > output.txt
How can I get a listing of just the file names without the extra information like permissions, timestamp, etc.?
Edit: And is it possible to output each file name on a new line?
After years of work, here is my solution to this age-old problem:
DIR=`mktemp -d /tmp/rsync.XXXXXX`
rsync -nr --out-format='%n' serveripaddress::pt/dir/files/ $DIR > output.txt
rmdir $DIR
Further to https://stackoverflow.com/a/29522388/2858703
If your mktemp
supports the --dry-run
option, there's no need to actually create the temporary directory:
rsync -nr --out-format='%n' serveripaddress::pt/dir/files/ $(mktemp -d --dry-run) > output.txt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With