0

Can anyone help me with this command which i have found out? Command is tar cf - . |ssh -l <TARG_SERVER_USER> <TARG_SERVER> "cd /d1/<INST_NAME>/apps/tech_st; tar xfBp - "

Correct me if I'm wrong but as I can see this is going to compress files in current directory while it copies it to destination location right? Does this means that current files will be intact (not going to be compressed)?

Thank you

  • why not scp them over with `-C` flag, it will handle compression for you? see: https://stackoverflow.com/questions/11304895/how-do-i-copy-a-folder-from-remote-to-local-using-scp – Lawrence Cherone Nov 10 '20 at 14:06
  • `tar` doesn't compress anything by default; it just combines files into a single stream of bytes. `ssh`, however, may compress any data before transmitting it, with the remote end decompressing it on arrival. That process, if it occurs, is completely transparent to the `tar` processes on either end. – chepner Nov 10 '20 at 14:20

1 Answers1

0

files in the current location '.' are only read and the tar output '-' is send to ssh

arlac77
  • 81
  • 3