How to send the output of siril-cli to a log file (when not using GUI)

I’m running siril-cli.exe from a bat file, outside of the GUI program, as part of automated stacking operations, and whilst the process/script works the stdout is sent to a separate cmd console window, which then quickly disappears when the process finishes giving no chance of spotting /reading any final error messages. The contents of one of my typical BAT files looks like this.

cd “C:\Program Files\Siril\bin”
start siril-cli.exe -d “C:\Data\ZWO Imaging\SharpCap\M37” -s
“C:\Data\SiriL\scripts\OSC_stackframes.ssf”

I want to redirect stdout to an output log. I would normally do this by adding >output.log to the command line, viz
start siril-cli.exe -d “workfolder” -s “scriptfile.ssf” >output.log

An output.log is produced but it is empty - the stdout continues to go the separate cmd window and then disappear upon completion.

Separately I find that I couldn’t successfully run siril-cli.exe from outside its folder area
If I use
start “C:\Program Files\Siril\bin\siril-cli.exe” -d “workfolder” -s “scriptfile.ssf” >output.log
I get the error “Windows cannot find ‘-d’. Make sure you’ve typed the name correctly”

So I run this in the Siril/bin program folder
cd “C:\Program Files\Siril\bin”
start siril-cli.exe -d “workfolder” -s “scriptfile.ssf” >output.log

but this give a permissions error, unless I run the bat file as Administrator
when I use Administrator, the Output.log is generated but empty
So If I use
cd “C:\Program Files\Siril\bin”
start siril-cli.exe -d “workfolder” -s “scriptfile.ssf” > C:\userpath\output.log
the Output.log is generated but is again empty

Of course I can run the script in the GUI interface which shows & preserves the log messages in its own console window after the script finishes, and this is what I have to do to debug/problem solve any issues with the script.

But for live observatory operations where I submit the bat file via a Shell I need to capture the log messages for later diagnostics & problem solving if required. Any idea how I can successfully redirect Siril-cli’s stdout to a log file ?

BAT file

cd “C:\Program Files\Siril\bin”

start siril-cli.exe -d “C:\Data\ZWO Imaging\SharpCap\M37” -s “C:\Data\SiriL\scripts\OSC_stackframes.ssf”

Hi,

so, many things here, let’s take them from the start:

  • if you want to skip specifying the full path to siril-cli.exe, you can add “C:\Program Files\Siril\bin” in your PATH, but that’s not strictly required in your case
  • I believe the main problem is the start call in your bat file. If I test with that, I can’t pass a -d argument (get the same error as you). And even after cd’ing to the correct folder, my log is empty. I believe it breaks down to the number of args which are parsed when we interpret the command.
  • So basically, just keep it simple:

"C:\Program Files\SiriL\bin\siril-cli.exe" -d "workfolder" -s script.ssf >C:\path\to\log\test.log

does exactly what you want.

Cheers

C.

Thank you C (cissou8).
Your solution works just fine, and helps me enormously. I now have it built into the control program / shell that creates my .bat files.
David

1 Like