Hi,
I am new to scripting, I need to write a script to transfer .TXT files from Server A (ftp) to Server B. Once the files in server B i need to transfer it to server C (sftp). (not transfer of files directly from server A to Server C )
Thanks!
Regards
Sendhil
---------- Post updated at 09:24 PM ---------- Previous update was at 08:27 PM ----------
can anyone suggest me how write a condition to check for file in server B and go for sftp of server c
#!/usr/bin/sh
SERVERB="/path/of/SERVERB"
FILE=".TXT"
cd $SERVERB
## SERVER A
ftp -n hostname << EOF
user uid pwd
cd ftp/path
binary
prompt off
mget ${FILE}*
bye
EOF
###### got stuck here :wall: please help me out to write a condition which for the .TXT in server B and then only proceeds for next
## SERVER C
sftp UsrID@hostname << End
cd sftp/path
binary
prompt off
mput ${FILE}*
bye
End