madMAx43v3r / chia-plotter

Apache License 2.0
2.27k stars 664 forks source link

Separate Logs for each plot #399

Open DimaVIII opened 3 years ago

DimaVIII commented 3 years ago

Hello!
I'm trying to separate logs produced by the plotter for each plot which will make it easier to analyze them later on. The problem is that the plotter does not end his process after a plot is finished as it continues copying the plot to the destination in the background. Currently if I would loop the process with bash it will only start a new plot after the destination copy process is finished. There is also no time output anywhere produced by the plotter.
Any ideas?

screen -d -m -S plotter bash -c 'ulimit -n 3000 && /usr/bin/plotter \
-n -1 \
-r 48 \
-u 512 \
-t /mnt/tmp/ \
-2 /mnt/plotter/ \
-d /mnt/cache/ \
-p xxxxxxxxxxxxx \
-f xxxxxxxxxxxxx \
|tee /home/chia/logs/plotter.log'
buglantiss commented 3 years ago

make a script with a loop that will create a single plot and add $(date) to the name of your log file

DimaVIII commented 3 years ago

@buglantiss My problem is that I don't know when the plot is done as the process ends as the copying phase is finished.

grayfallstown commented 3 years ago

Don't give it a final destination and run another script in parallel that keeps looking for finished plots and then moves them while your plotter is already working on the next one.

Dartellum commented 3 years ago

For those wanting separate logs for each run with time started:

#!/bin/bash
log=/path/to/log/folder
for i in `seq 1 300`;
do
   dt=$(date '+%Y-%m-%d_%H_%M_%S')
   echo "Currently plotting number $i and time started is $dt." |tee -a $log/$dt.log
   ./chia_plot -t /path/to/temp/ \
   -2 /path/to/temp2/ \
   -d /media/plots/farm/ \
   -p <poolkey> \
   -f <farmkey> \
   |tee -a $log/$dt.log
   echo "Time plot $i fininshed is $(date '+%H_%M_%S')." |tee -a $log/$dt.log
done
DimaVIII commented 3 years ago

@Dartellum B y removing the "-n" parameter the plotter gives an exit code before copying is finished?

@madMAx43v3r can you please confirm?

madMAx43v3r commented 3 years ago

No it will wait for copy to finish

Dartellum commented 3 years ago

For those wanting separate logs for each run with time started:

#!/bin/bash
log=/path/to/log/folder
for i in `seq 1 300`;
do
   dt=$(date '+%Y-%m-%d_%H_%M_%S')
   echo "Currently plotting number $i and time started is $dt." |tee -a $log/$dt.log
   ./chia_plot -t /path/to/temp/ \
   -2 /path/to/temp2/ \
   -d /media/plots/farm/ \
   -p <poolkey> \
   -f <farmkey> \
   |tee -a $log/$dt.log
   echo "Time plot $i fininshed is $(date '+%H_%M_%S')." |tee -a $log/$dt.log
done

I made a complete wrapper script that will check final destination disk space and select one based on free space available. See: https://github.com/Dartellum/chia-madmax-plot_loop.