Post
Topic
Board Mining (Altcoins)
Re: [OS] nvOC easy-to-use Linux Nvidia Mining v0019-1.3
by
leenoox
on 01/11/2017, 05:56:19 UTC

Finally I think this method will work to start screen's log file "on the fly"

Code:
screen -dr miner -X log

So some code like this would do the trick:

Code:
# First check if screen is running miner with the -L flag!!!
......
......

# End of first check if screen is running miner with the -L flag!!!

if [[ -f ~/screenlog.0 ]]; then
  > ~/screenlog.0
  screen -dr miner -X log       # Start login output from miner
  sleep 20                      # keep saving data for 20 seconds   
  screen -dr miner -X log       # Stop login output from miner
  # Get the miner statics
  TOTAL_HASHRATE=$(tail -60 ~/screenlog.0 | grep "Mining on PoWhash" | cut -d":" -f4 |  cut -d" " -f2 | sed 's/ /\n/g' | tail -3)
  .....
  .....

fi

I will add this method to kk003_telegram ASP + some new features and miners for statics.
Hope it helps.

It's really nice to add more features to nvOC and I would encourage everyone to try and contribute to this great project but I would strongly advice against using unnecessary extreme writing in logs to accomplish the proposed feature. Especialy recording the screen in screenlog...

You see people complainig every day of corrupted USB sticks, freezing, running out of space, boot problems, etc. USB stick as a medium is not designed for such operations, constant writing to USB stick is not recommended, it messes the controller, makes USB perform very slow after a while and kills memory cells which leads to corruption and lock-ups.

If nvOC was explicitly recommended as SSD/HDD OS, the logs would be fine but the reality is that 90% of people use nvOC from USB sticks.

To all devs: please avoid usage of logs as much as possible or at least log as little as possible.

Hint: if you want to show output from the miner in your script/program/telegram/web page (definetely a nice feature to show), record the output from the miner (or nvidia api) into memory then show it in your program on a per need basis. This is more easily done with PHP and Perl but it can be accomplished in Bash as well. Record stdout and stderr into rotating array (you can use shift for the array). You can record 10, 20, 100, even 500 lines and you won't run out of memory, then show the live output from the array into your featured program.