daily pastebin goal
93%
SHARE
TWEET

Untitled

a guest Jun 9th, 2018 371 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. username="username"
  4. password="unecessary if you have keyfile auth setup"
  5. host="IP address"
  6. port="port#"
  7. base_name="$(basename "$0")"
  8. lock_file="/tmp/$base_name.lock"
  9.  
  10. trap "rm -f $lock_file; exit" INT TERM
  11.  
  12. if [ -e "$lock_file" ]
  13. then
  14.     echo "$base_name is running already."
  15.     exit
  16. else
  17.     touch "$lock_file"
  18.     /usr/bin/lftp -p "$port" -u "$username","$password" sftp://"$host" << EOF
  19.     mirror --use-pget-n=20 -P 5 /remote/path /local/path
  20.     quit
  21. EOF
  22.     rm "$lock_file"
  23.     exit
  24. fi
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
Pastebin PRO 'AUTUMN SPECIAL'!
Get 60% OFF Pastebin PRO accounts!
 
Top