Topic "Script and parallel running"

Author Message
iZ

Guest


I´m having the following problem,

I have an "external" program which calls a .bat file (which generate and execute the WinSCP Script) for each file received by this external program.

The problem is the following,

If the external program receives, for example, 6 files at the same time... it calls 6 times the .bat file at the same time too. Then we have 6 .bat running parallel creating one Script, the same Script for the 6, and executing this Script 6 times... causing "random missing tranfers" (or that is what I think...)

I have tryed different ways to generate the name of each Script, but I saw on the .log file that the WinSCP commands are executed ones between the oders.... and for example:

Code:

   Script1                         Script2
1  Open XXXX                      Open XXXX
2  Transfer XXXXX
3  Transfer XXXXX
4                               Transfer XXXXX
5  Close                        Transfer XXXXX           <---- Not transfered
6                               Transfer XXXXX           <---- Not transfered     
.
.
.


Could someone please give a solution for this problem? I can´t find anything....

Thanks!!!
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
There should be no problem at all running multiple scripts in parallel (unless different instances try to upload the same file).

Other than that I do not understand your problem description. Can you share your script and a log file showing the problem? Also make sure each instance of the script write to a distinct log file.
_________________
Martin Prikryl
iZ

Guest


After taking a deep look I have seen that the problem was that the files were overwritten because the dates on the filenames were also the same.

How can I manage a "dynamic" filename generator?? The original filename is not an option. There is a possibility to use a "Global Counter" for the file names?
PrzemekK

Guest


prikryl wrote:
There should be no problem at all running multiple scripts in parallel (unless different instances try to upload the same file).

Other than that I do not understand your problem description. Can you share your script and a log file showing the problem? Also make sure each instance of the script write to a distinct log file.


Hi Martin,
what did you mean by
prikryl wrote:
unless different instances try to upload the same file
?
Is it a problem when two different instances upload the same file at the same time to different servers?
Actually I have an issue with this scenario. After I run such test, the parent process (cmd.exe) is not able to execute any .bat files afterwards.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
PrzemekK wrote:
Is it a problem when two different instances upload the same file at the same time to different servers?

No. This is not what this thread was about. It was about parallel uploads to the same server.

Quote:
Actually I have an issue with this scenario. After I run such test, the parent process (cmd.exe) is not able to execute any .bat files afterwards.

Start a new thread and provide some details.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License