Copy files over SSH: Difference between revisions

From Jwiki
Created page with "Category:General Linux tar cjf - /path/to/local/dir | ssh user@remote-host 'tar xjf - -C /path/to/remote/destination'"
 
No edit summary
Line 1: Line 1:
[[Category:General Linux]]
[[Category:General Linux]]


= Efficient File Transfer with Tar and SSH =
Efficiently transfer files using tar over SSH for DevOps tasks like Proxmox or Kubernetes migrations.
== Optimized Command ==
<pre><code class="bash">
tar cjf - /path/to/local/dir | ssh user@remote-host 'tar xjf - -C /path/to/remote/destination'
tar cjf - /path/to/local/dir | ssh user@remote-host 'tar xjf - -C /path/to/remote/destination'
</code></pre>
== Tips ==
- Use --exclude to skip files.
- Swap j for z (gzip) for faster compression.

Revision as of 08:19, 28 July 2025


Efficient File Transfer with Tar and SSH

Efficiently transfer files using tar over SSH for DevOps tasks like Proxmox or Kubernetes migrations.

Optimized Command

<code class="bash">
tar cjf - /path/to/local/dir | ssh user@remote-host 'tar xjf - -C /path/to/remote/destination'
</code>

Tips

- Use --exclude to skip files. - Swap j for z (gzip) for faster compression.