Windows 10 CLI plotting, redirecting log outputs

Hello,
im plotting on W10 from CLI with this command in bat file:

(example, i have one for each destination drive)
cd C:\Users\Honza\AppData\Local\chia-blockchain\app-1.1.3\resources\app.asar.unpacked\daemon chia plots create -k 32 -n 30 -b 4000 -r 8 -t F:\ -d U:\

Id like to add something like
-redirectstandardoutput C:\Chia\plotting_logs\WD_GOLD7_U.txt
because right now, im without plotting logs. Can anyone help me, how to do it?

Tee (aka Tee-Object) is your friend :wink:

If you do

chia plots create -t F:\ -d U:\ | tee -file-path "C:\Chia\plotting_logs\WD_GOLD7_U.txt" 

the output of the chia command will be shown on the console as well as streamed into the WD_GOLD7_U.txt file.

You can use the -append parameter to append to the file instead of overwriting it.

2 Likes

I try
chia plots create -t F:\ -d U:\ | tee -file-path

C:\Chia\plotting_logs\WD_GOLD7_U.txt

and i got β€˜tee’ is not recognized as an internal or external command, operable program or batch file.

Its looks like i can use

chia plots create -t F:\ -d U:\ >"C:\Chia\plotting_logs\WD_GOLD7_U.txt"

I only get output to text file, but i can live with that. I want to monitoring progres from text files.

Are you running the command in the console (cmd) or in powershell? It needs to be the latter, as tee is a powershell β€œprogram”.

2 Likes

My fault, i had to be more specific. Im runnig from cmd. Maybe in next Chia release i move to PowerShell. I dont want to stop all ploters right now. In any case, thank you for your help, it led me in the right direction.

I have been using powershell exclusively. Its phenomenal for debugging. I can post my scripts if you are interested. I’m pulling 29 plots per day all day. Very stable.

I discovered that when redirecting output, while using the command prompt (not powershell), the β€œ>” and β€œ>>” symbols results in the log being zero bytes.

So I tried redirecting standard error, via β€œ2>” or β€œ2>>” and that worked.

But it is not as good as piping to β€œtee”, because your command prompt outputs nothing. It all goes into the log.