I have a Web Report that is archived daily which I would like copied to another server by using the Customized Executable feature. I am currently attempting to use a batch file but am having problems because each report is put into a new folder with a name of 10 different numbers with no apparent pattern, e.g. 1166653742 or 1166655002. The server I’m copying the reports to needs AD credentials to connect, in the batch file I was using Net Use. I was thinking of pulling the folder with the most recent creation date but I don’t know the syntax and was hoping someone has done this before.
The 10 digit number is the number of seconds since 1970 (which is just an easy way to make sure that the folder names don’t collide). Our documentation on the custom executables is fairly sparse, but this might help… In the web reports help for Custom Executables, it reads:
+Customized Executable
The selected executable will run with the given arguments if the scheduled activity’s triggers are met. The executable will run as the Web Reports service’s user, and will run through the shell. It will run in the background without UI.
There are several special reserved parameters that can pass information about the activity to the executable:
: the scheduled activity’s name
: the file containing the generated report
: the scheduled activity’s creator
It sounds like if you use the “reportfile” parameter for your batch script, it will give it a path to the file you want so you can copy it.
Please post when you get this working and if you post your batch script code, I think lots of other people will benefit from it because it seems like something lots of people want to do.
I’m still having a little problem with the pathname for the Web Report. In Web Reports I specify my batch file as the executable and for the arguments I put: “” (Through trial and error I found you have to include the quotes if the path has spaces).
The pathname for the archive should be: “D:\Program Files\BigFix Enterprise\BES Server\BESReportsData\ArchiveData\TestArchive\1167762902\archive.csv”
The file “D:\Program Files\BigFix Enterprise\BES Server\BESReportsData\ArchiveData\custom-4.dat” is the output that is created for your report. The file “D:\Program Files\BigFix Enterprise\BES Server\BESReportsData\ArchiveData\TestArchive\1167762902\archive.csv” is created because you chose to archive the file in addition to the custom report.
You can copy the custom-4.dat file somewhere else (rename it if you want) using the batch script and you can verify it is the file you want.
Well it worked! I never saw custom-4.dat in Explorer (even with hidden files and system files showing) and I thought I had tried to copy that full path before but it didn’t work. I also discovered I could have gotten the file from “…\ArchiveData\LastRunReports” where the # in #.dat matches the Report ID in WebReports. Thank you Ben for your help. ~ Jason