tar Over ssh

On regular basis, we encounter the need to copy a whole directory between two hosts. Usually we do it when we clone oracle application software.
Each time I am looking for the right syntax … :( NO MORE !!!
tar cvf‎ – source_dir/ | ssh target_host "cd `pwd`;tar xvf‎ -"

This one will copy source_dir to‎ target_host
For slow connection‎:
tar cvf‎ – source_dir/ | gzip -c‎ | ssh target_host "cd `pwd`;gunzip -c|tar xvf‎ -"

You will enter password once‎ (probably‎)

Comments

doron said…
Hi ,

You can try this one as well:

tar cpf - . | (ssh user@host:/dest_dir ; tar xpf -) &


- doron

Popular posts from this blog

Fixing & Registering ORACLE_HOMES in Central Inventory

Export in Pl/Sql via DBMS_DATAPUMP

Oracle 18c - New Features for Active Data Guard