SHARE
TWEET

Untitled

a guest Sep 21st, 2019 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /usr/bin/bash
  2.  
  3. # copies local directory to $HOME/directory remotely
  4.  
  5. # $1 = path to directory locally
  6. # $2 = remote hostname to copy to
  7.  
  8. export BZIP="--best"
  9.  
  10. tar -cjvf /tmp/$1.tar.bz2 $1
  11. scp /tmp/$1.tar.bz2 $2:/tmp/$1.tar.bz2
  12. rm /tmp/$1.tar.bz2
  13. ssh "$2" "cd \$HOME; tar -xvjf /tmp/$1.tar.bz2 && rm /tmp/$1.tar.bz2"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top