Advertisement
Guest User

Untitled

a guest
May 16th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. # General mirror
  2.  
  3. USER=""
  4. PASSWORD=""
  5. HOST=""
  6. REMOTE_DIR=""
  7. LOCAL_DIR=""
  8.  
  9. lftp -u "$USER","$PASSWORD" $HOST <<EOF
  10. # the next 3 lines put you in ftpes mode. Uncomment if you are having trouble connecting.
  11. # set ftp:ssl-force true
  12. # set ftp:ssl-protect-data true
  13. # set ssl:verify-certificate no
  14. # transfer starts now...
  15. mirror -P10 --size-range=0-9M $REMOTE_DIR $LOCAL_DIR && bye;
  16. exit
  17. EOF
  18.  
  19. # include-glob:
  20.  
  21. lftp -u $USER,$PASSWORD -e 'mirror -P10 --continue --size-range=0-9M $REMOTE_DIR --include-glob "*.js" $LOCAL_DIR && bye' $HOST
  22.  
  23. # exclude:
  24.  
  25. lftp -u $USER,$PASSWORD -e 'mirror -P10 --continue --size-range=0-9M $REMOTE_DIR --exclude path/or/file $LOCAL_DIR && bye' $HOST
  26.  
  27. # Some files alone by giving the paths:
  28. Whil read path; do
  29. lftp -u $USER,$PASSWORD -e 'mirror -P10 --continue --size-range=0-9M $path $LOCAL_DIR && bye' $HOST
  30. done < filepaths_to_mirror.txt
  31.  
  32. # file_permission issue:
  33.  
  34. lftp <<EOF
  35. # the next 3 lines put you in ftpes mode. Uncomment if you are having trouble connecting.
  36. #set ftp:ssl-allow no
  37. #set ftp:passive-mode true
  38. #set ftp:list-options -a
  39. open -u [user],[password] [host]
  40. # changing file permissions starts now...
  41. chmod 777 /public_html/images/cache/thanos.jpeg
  42. EOF
  43.  
  44. # miscellaneous:
  45.  
  46. lftp_rc
  47. should do it.
  48.  
  49. If this doesn't work try adding to your /etc/lftp.conf the following lines:
  50.  
  51. set ftp:ssl-protect-data true
  52. set ftp:ssl-force true
  53. set ftp:ssl-auth TLS
  54. set ssl:verify-certificate no
  55.  
  56. # cache flush
  57. # ls | tr "\n" " "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement