總網頁檢視次數

星期五, 12月 20, 2019

How to sftp files automatically

sshpass -p YOUR_PASSWORD sftp -oBatchMode=no -b YOUR_COMMAND_FILE_PATH USER@HOST


sftp login@host < /path/to/command/list



To do this safer put export SSHPASS='your_password' to ~/.bashrc and run with -e flag. I have used this cmd in some project like this: echo 'ls -t upload/*.xml' | sshpass -e sftp -oBatchMode=no -b - user@example.com | grep -v "sftp>" | head -n1

沒有留言: