We are sending hundreds of files every minute to several servers.
Currently we are generating the shell scripts (as files via java) which contains only sftp commands and executing them as shell scripts. The reason why we are using java is to organize the files based on target path and target server. At the end, for each target server we will have one shell script.
Now I am thinking will it be more efficient and fast if I send the files via java code itself instead of generating script and executing it
Currently it takes 4 to 5 seconds to generate the scripts for 4 servers. So the execution of actual sftp starts at 5 th second and finishing very fast (based on files count). If I switch to java sftp like JSch will it be the same fast as sftp in shell script or slower?