Guest User

Untitled

a guest
May 27th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.36 KB | None | 0 0
  1. #Script
  2. PORT=1111
  3. USER=user
  4. remote_ssh="ssh -l $USER -p $PORT"
  5.  
  6. # Do not put a command in a variable. (Certainly not a local one anyway.)
  7. rsync -avH -e "$remote_ssh" user@server:/foo/bar /foo/bar
  8.  
  9. # If for some reason you must contain the command, use a function:
  10. rsyncme() {
  11.     rsync -avH -e "$1" user@server:/foo/bar /foo/bar
  12. }
  13.  
  14. rsyncme "$remote_ssh"
Add Comment
Please, Sign In to add comment