I would like to backup a directory from my production server to a backup server using rsync.
My current solution:
- tar directory
- on production server send to remote server via rsync
My Problem with this solution: there is not enough space to create the tar file + it needs to much resources while the tar is created. It should make as less as possible impact on the production server resources.
I would like to send the files into a tar file on the remote server. I simply could send the files and tar them on the backup server, but in my point of view, this would not be a good solution.
Best Answer
You could use a combination of pipes and STDOUT to send the tar file over the network to the remote server.
The "-" character sends the tar to STDOUT which is piped to
ssh
and the contents written to a regular file usingcat
.You'll need to use
ssh
with a private key file for "passwordless" authentication.This doesn't use
rsync
but will get the tarfile to the remote server.Reference: https://stackoverflow.com/questions/8045479/whats-the-magic-of-a-dash-in-command-line-parameters