-
-
Save markheramis/88677e9d994128b39d7341da31dd8e1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment