The windows version of this is
@echo off
REM cgminer
:Loop
Set NOW=%date:~10,4%%date:~7,2%%date:~4,2%.%time:~0,2%%time:~3,2%%time:~6,2%
.\cgminer.exe --no-restart --api-port 4028 --api-listen --api-allow W:127.0.0.1,W:192.168.1.0/24 --api-description Des -c pools.json 2> "run.%NOW%.log"
echo Sleeping for 5 seconds
ping -n 5 127.0.0.1 > NUL
GOTO Loop
If someone is interested, here is my linux version:
#!/bin/bash
for (( ; ; ))
do
cgminer --config cg_$1_$2.conf 2>log$2.log
echo sleeping.....
sleep 5
echo done sleeping
done
I'm using few instances of cgminer for different devices and with parameters I can start different configs.
For example:
./gocg btc e
Runs config file cg_btc_e.conf logfile loge.log for my erupters.
(how I do it - though I do it in 2 scripts one that calls the other - this is essentially what it is)
#!/bin/bash
#
nam="$HOME/cgminer-run.log"
while true ; do
echo "`date`: Starting cgminer" 2>&1 | tee -a "$nam"
ulimit -c 2097152
now="`date +%Y%m%d%H%M%S`"
./cgminer --api-listen "$@" 2> "$HOME/run.$now.$$.log"
s="$?"
echo "`date`: cgminer exited status ($s)" 2>&1 | tee -a "$nam"
echo "`date`: Sleeping for 5..." 2>&1 | tee -a "$nam"
sleep 5
done
Any other options you want you can add when you run it
So e.g. if you call it cgminer.sh
You can run it as:
./cgminer.sh -c pools.conf
In your $HOME directory you'll have cgminer-run.log that will list all the starts and stops
And run.YYYYMMDDHHMMSS.$$.log for each run