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

  1. Hi ,

    You can try this one as well:

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


    - doron

    ReplyDelete

Post a Comment

Popular posts from this blog

Silent Installation

Data Guard - Changing IP Addresses

Fixing & Registering ORACLE_HOMES in Central Inventory