Need to transfer a file, rename it and close the connection for each file where I have multiple files using sftp.
Server A - Source Server B - destination
I need to transfer files form server A to server B using sftp Sample files on the server A - local_file001-100
Path on sever A - /data/sftp Path on server B - /home/local/sftpuser This is what I have come up with, which transfers the file and renames it to todays_local_file but does not close the connection after each file transfer. I have a requirement which needs connection terminated after each file transfer and reconnect for the next one.
sftp email@example.com:/home/local/sftpuser <