web stats
Run Shell Script after FileReader - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-16-2016, 01:16 PM
themochael themochael is offline
OBX.2 Kenobi
 
Join Date: Sep 2013
Posts: 54
themochael is on a distinguished road
Default Run Shell Script after FileReader

Is there a way I can run a shell script after I do a file read? Perhaps in a postprocessor script?

The shell is sudo DeleteIt.sh
Reply With Quote
  #2  
Old 02-16-2016, 06:00 PM
rigved rigved is offline
OBX.1 Kenobi
 
Join Date: Jun 2014
Posts: 31
rigved is on a distinguished road
Default

Check out Utility Function "Call System Function" under References. You should be able to run your script using that command as long as the user running mirth connect has permission to run that shell script.
Reply With Quote
  #3  
Old 02-16-2016, 06:06 PM
themochael themochael is offline
OBX.2 Kenobi
 
Join Date: Sep 2013
Posts: 54
themochael is on a distinguished road
Default

Thank you for this info. I actually figured out a way around it:

Created a FileReader - SFTP for the directory I am watching for log files. Once a file is dropped, I have a destination to no where (Channel Writer). I have a postprocessor job that then kicks off a batch file. Inside the batch file is a plink command that executes my shell script.

Code:
Runtime.getRuntime().exec("cmd /c start D:\\TEST\\get.bat");
return;
Reply With Quote
  #4  
Old 02-17-2016, 06:55 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

This might help: http://www.mirthcorp.com/community/f...7649#post47649
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
Reply

Tags
postprocessor

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:55 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation