relay files via tar+ssh+cat


/ Published in: Bash
Save to your folder(s)

rsync doesn't like to copy files from host to host. This is sort of the "old school" unix way - tar everything to a pipe, then pipe everything out. It's how we used to copy directories remotely before we had tools like rsync. I'm definitely open to suggestions on how to improve this (even a fix for rsync, if I'm wrong)


Copy this code and paste it in your HTML
  1. ssh SERVER_FOO "tar czf - DIR_FOO 2> /dev/null" | ssh SERVER_BAR "cat > /tmp/FILES_FROM_FOO-data.tgz"

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.