Copy files with tar over SSH ============================ Author: Momchil Ivanov Date : 2013.09.21 Introduction ------------ This article describes how to copy files with tar over SSH. Create a tar archive over SSH ----------------------------- Create a tar archive directly over SSH: $ ssh server "tar cvf - /path/to/data" > file.tar This command creates a tar archive file.tar on the local machine with the content of the directory /path/to/data from server. Copy files with tar over SSH ---------------------------- Copy files and directories with tar over SSH: $ ssh server "tar cvf - /path/to/data" | tar xvf - -C /new/root/path This command copies the content of the directory /path/to/data from server to the local directory /new/root/path.