Copy a directory to another server with tar over SSH
tar over ssh copy directory | transfer website to new server | copy many small files over ssh fast | tar | ssh | migrationCaution: This command changes the system. Understand what it does before you run it.
tar czf - -C /var/www/vhosts/example.com/httpdocs . | ssh webuser@neuserver.example.com "tar xzf - -C /var/www/vhosts/example.com/httpdocs"Packs the contents of the source directory, sends the data stream through SSH and extracts it on the target. This saves space for an intermediate archive and is often faster than scp with many small files. The target directory must already exist.
Note: Files with the same name on the target are overwritten. For repeated syncs, rsync is the better choice.
Also searched as
- tar over ssh copy directory
- transfer website to new server
- copy many small files over ssh fast