Powered by Jitbit .Net Forum free trial version. dismiss

HomeProblems and issues

Post bug reports here. The forum is pre-moderated, your message will appear after being checked by us.

"Run set of custom commands" for scheduled reports Messages in this topic - RSS

Ullrich B
Ullrich B
Posts: 5


8/17/2018
Ullrich B
Ullrich B
Posts: 5
Hi,
could you please provide a FAQ-Entry about the feature "Ability to run set of custom commands and scripts, passing path to the generated report file as an argument"? What i want to do is saving results of scheduled reports for further processing, may be in a monitored local folder.

Best regards
0 link
Gleb
Gleb
Administrator
Posts: 48


8/17/2018
Gleb
Gleb
Administrator
Posts: 48
Hi, thank you for your suggestion, we will add this.

In the meantime, here is the quick instruction how to save the report file in c:\backup folder:

1) When creating a schedule, under Action tab select "Run custom commands"
2) In the "Command line" field type powershell
3) In the "Command arguments" field, type c:\scripts\copy.ps1 c:\backup
4) Create file c:\scripts\copy.ps1 with the following content:

Copy-Item $args[1] -Destination $args[0] -Force -Recurse

5) Make sure that powershell script execution is enabled for x86. See this post for details: https://stackoverflow.com/questions/4037939/powershell-says-execution-of-scripts-is-disabled-on-this-system

When the scheduler executes a custom command, it invokes the command line and passes the arguments. The last argument always will be the generated file name. Therefore within your script $args[1] will be the generated file name, and $args[0] will be "c:\backup".

You can add extra actions such as renaming the file within the script as you wish.

In order to test the scheduler without waiting for the scheduled time, go to http://yoursqlwallethost/hangfire/recurring, select the scheduled job and press "Trigger now" button. If you have the latest release 1.5.0, you will find the link to the jobs console in the Admin menu.
edited by Gleb on 8/17/2018
0 link






Powered by Jitbit Forum 8.3.8.0 © 2006-2013 Jitbit Software