Skip to main content
Question

competition between process in a batch file

  • January 18, 2017
  • 9 replies
  • 40 views

arthy
Contributor
Forum|alt.badge.img+8

I wrote a batch file 

fme workbench.fmw
robocopy process_folder share_folder /COPYALL /E /IS /NP

that run during approximately two hours and at the end of the translation I'm copying the processed file to another folder that is shared with many users.

 

 

The issue that I'm havcing is that the robocopy action starts before fme frees the last translated file.

Is there anyway to oblige fme to free all the files before the next action in a batch files?

 

I know that I can add a timeout action but this means that I would have to try several times to determine the good time to be set when calling timeout.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

9 replies

erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • January 18, 2017

I would use FME (a second workspace or two workspaces in a runner workspace using the WorkspaceRunner transformer) to copy the files to the destination.

Have a look at the "File Copy" writer.

I used it a lot and get very good performance from it.


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • January 19, 2017

another option is a python shutdown script in the same workspace to do the copying.


Forum|alt.badge.img+7

Hi @arthy

Another option is to use a FeatureWriter, FeatureHolder, Sampler and SystemCaller combination.

 

The first three transformers are there to make sure only one features stays active when all files are written. The SystemCaller is used to call the copy command.

P.S. The FeatureHolder and Sampler are only necessary when you are using multiple FeatureWriters. I just implemented them to show how to do this.


Forum|alt.badge.img+7

I would use FME (a second workspace or two workspaces in a runner workspace using the WorkspaceRunner transformer) to copy the files to the destination.

Have a look at the "File Copy" writer.

I used it a lot and get very good performance from it.

http://docs.safe.com/fme/2016.1/html/FME_Desktop_Documentation/FME_ReadersWriters/filecopy/filecopy.htm

 

 


david_r
Celebrity
  • January 19, 2017

For a solution that's completely independent of FME, try inserting the following line between the call to FME and robocopy in your batch file:

timeout /t 6 /nobreak

This will wait for 6 seconds before proceeding and it should give FME ample time to release the file handles.


arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • January 19, 2017

another option is a python shutdown script in the same workspace to do the copying.

I wrote a python shutdown script using util but it did not solve the issue.

 


arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • February 9, 2017

@david_r,

 

 

Yesterday the batch file runs but it failed.

 

Looking at the fme lof file, the workbench ended at 2017-02-08 19:38:56 while looking athe file's properties, the last file was released by FME at 2017-02-08 22:48.

 

 

There is a basically a 3 hours gap between the end of the process and the moment FME released the file. I was so generous and added a timeout of 1h and half (timeout /t 2700 > nul) but it wasn't enough.

 

 

Is there another way to close all the file opened by FME?

david_r
Celebrity
  • February 9, 2017

@david_r,

 

 

Yesterday the batch file runs but it failed.

 

Looking at the fme lof file, the workbench ended at 2017-02-08 19:38:56 while looking athe file's properties, the last file was released by FME at 2017-02-08 22:48.

 

 

There is a basically a 3 hours gap between the end of the process and the moment FME released the file. I was so generous and added a timeout of 1h and half (timeout /t 2700 > nul) but it wasn't enough.

 

 

Is there another way to close all the file opened by FME?
That sounds really weird, I've never seen or heard anything like it.

 

Looking in the Task Manager, do you have any lingering instances of fme.exe running after the translation has terminated?

 

Which version of FME are you running? Maybe try an upgrade.

arthy
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • February 9, 2017
That sounds really weird, I've never seen or heard anything like it.

 

Looking in the Task Manager, do you have any lingering instances of fme.exe running after the translation has terminated?

 

Which version of FME are you running? Maybe try an upgrade.
@david_r,

 

 

I was using fme2011 and I switched to fme2014 and it didn't work so I guess that the version that I'm using is not really the problem