Skip to main content

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.

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.


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


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.


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

 

 


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.


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.

 


@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,

 

 

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.
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

 

 


Reply