ambuli
asked on
How to write a batch file
Hi Experts,
I have a windows batch file which actually uses winscp to upload some files to a Linux server. I want to do the same thing from a Linux machine to another Linux machine.
option batch on
option confirm off
option transfer binary
open root:default@100.200.100.2 00
cd /myDir
put C:\Ambuli\my.jar
put C:\Ambuli\lib\*.jar
close
exit
I have a windows batch file which actually uses winscp to upload some files to a Linux server. I want to do the same thing from a Linux machine to another Linux machine.
option batch on
option confirm off
option transfer binary
open root:default@100.200.100.2
cd /myDir
put C:\Ambuli\my.jar
put C:\Ambuli\lib\*.jar
close
exit
Depends how multiple files are defined...
scp root@10.37.202.100:~/Ambul i/test root@10.37.202.100:~/Ambul i/anotherf ile ~/ambulie/
would copy both test and anotherfile to ~/ambulie/
scp root@10.37.202.100:~/Ambul
would copy both test and anotherfile to ~/ambulie/
ASKER
Hi amit_g
The problem with this is that I have to type the password again and again.
The problem with this is that I have to type the password again and again.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
just noticed I messed up this line
scp root@<each server>:~/.ssh/authorized_ keys2
it should be
scp ~/.ssh/id_rsa.pub root@<each server>:~/.ssh/authorized_ keys2
sorry for any confusion
scp root@<each server>:~/.ssh/authorized_
it should be
scp ~/.ssh/id_rsa.pub root@<each server>:~/.ssh/authorized_
sorry for any confusion
ASKER
scp root@10.37.202.100:~/Ambul
and it works, but how can I enhance this so that I can copy multiple files.