linux - Run SFTP commands in a bash script -


hi community dwellers,

i have requirement -

  1. need place csv files local linux server remote linux/windows box.

actions -

  1. we have passwordless connectivity establish between local , remote boxes.
  2. able sftp remote server below command -

    sftp -o port=11001 user@xx.xx.xx.xx 
  3. able copy using put command -

    put /dir/local/*.csv user@remote:/usr/dir/ 
  4. tried execute above commands in bash script , can reach till sftp login.

  5. tried running batchfile (in try 1) in statement in step 1, can see uploading data, when pwd, folder empty, no idea files getting written, same try 2 statement -

try 1 - sftp -b test.sh -o port=11001 user@xxx.xx.xx.xx

or

try 2 - sftp -o port=11001 {user}@{host}:{remote_dir} <<< $'put {local_file_path}'


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -