Guest User

Untitled

a guest
Jul 30th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Try this. Save as "sftp.sh" file
  2. transfer 600+ tb from remote to local. requested by mark heramis
  3. #!/usr/bin/sh
  4.  
  5. USER=username
  6. PASS=password-eh-alangan
  7. URL=ip-sa-site-127.0.0.1
  8. PORT=27
  9. DEST=/local/path/
  10. FILES=/file/*
  11. LOG_DATE="`date +%Y-%m-%d-%H.%M.%S `"
  12. LOG=/path/log/${LOG_DATE}-FTP.log
  13.  
  14. echo "Commencing SFTP transfer of ${FILES} from ${URL}:${PORT} to ${DEST} on ${LOG_DATE}." >> ${LOG}
  15. sftp -e "set sftp:passive-mode on && cd ${DEST} && put ${FILES} && bye" -u ${USER},${PASS},${URL}:{PORT}
  16.  
  17. echo "SFTP transfer from ${URL}:${PORT} to ${DEST} finished at ${LOG_DATE} system time." >> ${LOG}
  18.  
  19. echo "we're done here captain!"
  20.  
  21. sleep 12h #we'll display the bash window for 12hours
Add Comment
Please, Sign In to add comment