0
私はUNIXを初めて使用しています。ファイルを送信するための正しい方法を見つける手助けが必要です。パスワードでsftpで転送するには? putコマンドでフルファイルを送信しない
私は大きなファイル1GBを送信する必要があり、手動でsftpにかかる時間は約10分です。パスワードでログインする必要があるため、以下のスクリプトを試しました。
ここでの問題は、ファイルを完全に転送する前です。スクリプトはエラーなしでSFTP接続から出てきます。
スクリプト:
` expect -c " `
spawn sftp ${remote_user}@${remote_host}
expect \"password\"
send ${remote_pswd}\r
expect sftp>
send \" cd ${remote_path}\r \"
expect sftp>
send \" lcd ${source_path}\r \"
expect sftp>
send \" put ${source_file} \r \"
expect sftp>
send \" echo $? \r \"
expect sftp>
send \"bye\" " ' `
ログイン:
` spawn sftp [email protected]
[email protected]'s password:
Connected to 192.168.79.15.
sftp> cd /users/StoreStockManagement/ReferenceData/Inbound
sftp> lcd /staging/oretail/external/data/DSPRD/Output/Pricing/INT340
sftp> mput hhtstore_price.dat
Uploading hhtstore_price.dat to /users/StoreStockManagement/ReferenceData/Inbound/hhtstore_price.dat
hhtstore_price.dat 3% 189MB 18.1MB/s 04:31 ETA+ [[ 0 -ne 0 ]]`
--Hereこのスクリプトが出てくると私はそこにファイルを見ることができないファイルの3%を転写した後。しかし、手動でsftpを試してみるとうまくいきます。スクリプトでのみコピーしていません。
はここ