Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Try this. Save as "sftp.sh" file
- transfer 600+ tb from remote to local. requested by mark heramis
- #!/usr/bin/sh
- USER=username
- PASS=password-eh-alangan
- URL=ip-sa-site-127.0.0.1
- PORT=27
- DEST=/local/path/
- FILES=/file/*
- LOG_DATE="`date +%Y-%m-%d-%H.%M.%S `"
- LOG=/path/log/${LOG_DATE}-FTP.log
- echo "Commencing SFTP transfer of ${FILES} from ${URL}:${PORT} to ${DEST} on ${LOG_DATE}." >> ${LOG}
- sftp -e "set sftp:passive-mode on && cd ${DEST} && put ${FILES} && bye" -u ${USER},${PASS},${URL}:{PORT}
- echo "SFTP transfer from ${URL}:${PORT} to ${DEST} finished at ${LOG_DATE} system time." >> ${LOG}
- echo "we're done here captain!"
- sleep 12h #we'll display the bash window for 12hours
Add Comment
Please, Sign In to add comment