0

I have a rsync command that does this:

rsync -a path postgres@12.19.232.116:/home/postgres/data/wals < /dev/null

I want to also redirect the output of this command to a file (ie > output.log), while preserving < /dev/null. How do I do so?

melpomene
  • 81,915
  • 7
  • 76
  • 137
Henley
  • 19,640
  • 29
  • 114
  • 195
  • 2
    `rsync -a postgres@12.19.232.116:/home/postgres/data/wals < /dev/null > output.log` – PSkocik May 15 '18 at 20:06
  • You may also find this useful: What is /dev/null 2>&1?https://stackoverflow.com/questions/10508843/what-is-dev-null-21 – Andrew Prentice May 15 '18 at 20:13
  • 1
    @HenleyChiu: Just being curious: What's the purpose to redirect stdin to the bitbucket? In your command, rsync is not reading from stdin anyway. – user1934428 May 16 '18 at 05:10
  • it's one of those things where it's has been working well with that for the past 3 years, and I don't want to change it because my job now is to add the new redirect, not change stuff :) Sure, I could refactor it but that's easy to say when u're not the one that wakes up at 2 AM when something unforseen happens :) – Henley May 22 '18 at 20:07

0 Answers0