Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/bash
- # copies local directory to $HOME/directory remotely
- # $1 = path to directory locally
- # $2 = remote hostname to copy to
- export BZIP="--best"
- tar -cjvf /tmp/$1.tar.bz2 $1
- scp /tmp/$1.tar.bz2 $2:/tmp/$1.tar.bz2
- rm /tmp/$1.tar.bz2
- ssh "$2" "cd \$HOME; tar -xvjf /tmp/$1.tar.bz2 && rm /tmp/$1.tar.bz2"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement