Template:egTarOverSsh

From RaySoft

Syntax

{{egTarOverSsh}}

Usage

Code

{{egTarOverSsh}}

Result

Get / store a tar file from / on a remote machine using SSH
tar --create --bzip2 --file=- "${HOME}/office" "${HOME}/private" \
| ssh 'melman@neon.raysoft.loc' "cat >${HOME}/backup/$(date +%F).tar.bz2"
ssh 'melman@neon.raysoft.loc' "tar --create --bzip2 --file=- \
   ${HOME}/office ${HOME}/private" >"${HOME}/backup/$(date +%F).tar.bz2"