Skip to content

Instantly share code, notes, and snippets.

@fagci
Created May 14, 2019 12:14
Show Gist options
  • Save fagci/654dd73ec9b0d861a5893384f3fb6246 to your computer and use it in GitHub Desktop.
Save fagci/654dd73ec9b0d861a5893384f3fb6246 to your computer and use it in GitHub Desktop.
Zip directory and copy it to remote server without creating file on local machine.
#!/usr/bin/env bash
FROM_DIRECTORY=$1
SERVER=$2
TO_ARCHIVE=$3
zip -r - $FROM_DIRECTORY | ssh $SERVER "cat > $TO_ARCHIVE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment