[WLUG] Linux, Monero and Hardware Issue

Paul set.mailinglist at gmail.com
Sun Mar 26 21:29:31 EDT 2017


Chris Baty <batymahn at gmail.com>, on Sun  2017.03.26 said:
> Hi guys,
> A juicy Linux question now: I got my XMR miner  working now and it spits
> out activities to I assume stdio, or the terminal.  It occasionally hangs
> and the process has to be killed and restarted.  I was  wondering if you
> could write a script where you write the output to a file, with a
> timestamp.  If the timestamp was older than 10 seconds than kill and
> restart the miner?
> Thanks.
> Chris
> 

	Hi;

	You could use stat with something like this simple script, I suppose:

Paul

------

#!/bin/sh

INTERVAL="10s"
FILE="logfile"
MTIME=$(stat -c "%y" $FILE)
while true; do
        echo "$MTIME"
        sleep $INTERVAL
        NEW_MTIME=$(stat -c "%y" $FILE)
        if [ "$MTIME" = "$NEW_MTIME" ] ; then
                echo "$FILE was not modified in the space of $INTERVAL"
                # restart daemon here
        fi
        MTIME=$NEW_MTIME
done



More information about the washlug mailing list