I have a sftp file script with below details,my server folder like BCP11,BCP12,BCP13,BCP14.....BCPXX
. In which BCPDUMP
folder have files.
Filename : file_sftp.sh
#!/usr/bin/expect
spawn sftp [email protected]
expect "[email protected]'s password:"
send "password\n"
expect "sftp>"
send "get *Backup/GetBackup/BCP*/*BCPDUMP/20150925/20150925_profile*\n"
expect "sftp>"
send "bye\n"
When i am executing this script i am getting only one file while the server have approx 12 files. i am getting below script output.
spawn sftp [email protected]
Connecting to xx.xxx.x.xxx...
Password:
sftp> get *Backup/GetBackup/BCP*/*BCPDUMP/20150925/20150925_profile*
Couldn't get handle: No such file or directory^M
Couldn't get handle: No such file or directory^M
Couldn't get handle: No such file or directory^M
Fetching /rsi/Backup/GetBackup/BCP10/BCPDUMP/20150925/20150925_profile_410.list.Z to 20150925_profile_410.list.Z
^M/rsi/Backup/GetBackup/BCP10/BCPDUMP/20150925/20150925_profile_410.list.Z 0% 0 0.0KB/s --:-- ETA^M/rsi/Backup/GetBackup/BCP10/BCPDUMP/20150925/20150925_profile_410.list.Z 66% 1152KB 1.1MB/s 00:00 ETA^M/rsi/Backup/GetBackup/BCP10/BCPDUMP/20150925/20150925_profile_410.list.Z 100% 1730KB 864.9KB/s 00:02
scp
orrsync
20150925_profile_410.list.Z
and located in different directories? Or do they all have distinct names? If you download two files with the same name, the second one will overwrite the first. What doesls *Backup/GetBackup/BCP*/*BCPDUMP/20150925/20150925_profile*
list?