Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • Welcome to unix.se! Please post the error message. When you do not want to locally create a file with tar, you can drop the f option and -: tar cvz prod_test.txt| ssh [email protected] "cat > prod_test5.tar.gz". Both versions worked for me. Commented Feb 15, 2017 at 6:46
  • tar: -: Cannot stat: No such file or directory tar: prod_test.txt|: Cannot stat: No such file or directory tar: ssh: Cannot stat: No such file or directory tar: [email protected]: Cannot stat: No such file or directory tar: "cat: Cannot stat: No such file or directory tar: >: Cannot stat: No such file or directory tar: prod_test4.tar.gz": Cannot stat: No such file or directory v ÷Om7 7Þ'(tar: Error exit delayed from previous errors Commented Feb 15, 2017 at 6:56
  • 2
    Then please post the code from your script. Do you use bash? Did you try a space between prod_test.txt and pipe? Commented Feb 15, 2017 at 6:59
  • 2
    @Farrukh We can't make much out of your code if you don't put it in the text of the question and format it properly. Please press the edit link above to edit the question. Commented Feb 15, 2017 at 7:20
  • 1
    @daniel not every version of tar defaults to stdout. It's better to be explicit and keep the -f - unless you can be absolutely sure if the default setting. Commented Feb 15, 2017 at 9:01