windowspostgresqlpgagent

Is it possible to run a .exe in windows through pgAgent?


My company currently applies PostgreSQL 10 and windows server 2008 OS.

I need to run a C wrote calculation program in .exe file each month.

However, it is not perfect to double click and run it every month. Furthermore, I would like to be able to run it at anytime where most of the resources are free (like mid-night). So I would like to ask if any of the following would be possible?

  1. Setup a job in pgAgent to auto-run .exe file each month?

  2. And is there a way to get returned info from the running results?

Thanks for anyone who gives any clue.


Solution

  • Windows Task Scheduler would be better suited for this task. You can select your .exe, set a run date/time and frequency. If you provide a user/password, it can run the task even if you are not logged in. See here for a tutorial.