I have a batch script, in which I am logging into an SFTP server and moving around some files. To do this, I've copied the public key so that there's no user interaction between me and the server. The script should just enter the hostname, the username and the port, and then move around some files, without entering a password. However, when I run my script, only the first line is running (the sftp
command).
Here is the script:
sftp -oPort=PORT USER@HOST_IP_ADDRESS
pwd
cd mcservers/earth/plugins
pwd
rm SomeFile.jar
put "C:\Users\USER\Documents\THE_PATH\target\AnotherFile.jar"
exit
I've tried putting an ampersand after my lines but it didn't work. What can I do?