[LUNA] Cron
Michael W. Hall
hallmw at att.net
Tue Jun 17 19:43:38 CDT 2014
That is what I was thinking. I believe that it would just fire off a
new copy bfgminer. I mainly need to detect if a process called bfgminer
is running. If so, then just wait and check later. If not, then start
it again.
I am not sure if this is feasible, but sometimes bfgminer will say a
miner is dead if it has stopped responding. I would like to restart
bfgminer then also. Not sure if you could detect that. Anyone mining
on the group?
Michael
On Mon, 2014-06-16 at 19:33 -0500, Paul F. Pearson wrote:
> i didn't think of that. i'm not sure of the loop method was intended to run from cron. Of course you're right, if that was the intent.
>
> ------
> Paul F. Pearson
> We all laugh in the same language
>
> ----- Bob Nance <bob.nance at novationsys.com> wrote:
> > Sorry, I was confused. I thought that was going to be a script called by cron. That would cause it to fork a new script every time cron was triggered which would fire off another miner on to of the one that was already there. My bad.
> >
> > ---
> > Bob Nance
> > Novation Systems
> > 256-534-4620
> >
> > (iPhone-flavored)
> >
> >
> > On Jun 16, 2014, at 4:20 PM, "Paul F. Pearson" <pfpearson at mchsi.com> wrote:
> >
> > >> Wouldn't that just stack the system with a new copy
> > >
> > > Only if bfgminer forks a new process then exits. Otherwise, the script will be blocked until bfgminer exits.
> > >
> > > Someone else suggeted using wait. That would be appropriate if the process runs in the background.
> > >
> > > Here's a few examples to demonstrate (I'll use a loop to answer the fear of "stacking the system"). In the first example, xclock will come up once; when you close it it will come up again in 10 seconds. You'll only see it 3 time. In the second example, xclock will come up three times 10 seconds apart. The third example will behave like the first.
> > >
> > > # Example 1: script will block until xclock exits
> > > #!/bin/sh
> > >
> > > for i in 1 2 3; do
> > > xclock
> > > sleep 10
> > > done
> > >
> > >
> > > # Example 2: script will not block
> > > #!/bin/sh
> > >
> > > for i in 1 2 3; do
> > > # run xlcok in the background; I think sh does this using a fork
> > > xclock &
> > > sleep 10
> > > done
> > >
> > > # Example : script will block until xclock exits
> > > #!/bin/sh
> > >
> > > for i in 1 2 3; do
> > > # run xlcok in the background; I think sh does this using a fork
> > > xclock &
> > > # now, wait for the xclock process to finish
> > > wait $!
> > > sleep 10
> > > done
> > >
> > > Caveats: I only know what Michael said about bfgminer, so I can't say how it behaves. My brain isn't working well enough to use the right terminology about blocking, etc.
> > >
> > > ------
> > > Paul F. Pearson
> > > We all laugh in the same language
> > >
> > > ----- "Bob Nance" <bob.nance at novationsys.com> wrote:
> > >
> > >> Wouldn't that just stack the system with a new copy of the software
> > >> running? Or is the software smart enough to not run twice?
> > >>
> > >> ---
> > >> Bob Nance
> > >> Novation Systems
> > >> 256-534-4620
> > >>
> > >> (iPhone-flavored)
> > >>
> > >>
> > >>> On Jun 13, 2014, at 8:40 PM, "John Price" <jp_luna at gcfl.net> wrote:
> > >>>
> > >>> How about something much simpler...
> > >>>
> > >>> #!/bin/sh
> > >>> while /bin/true; do
> > >>> bfgminer <various command line params>
> > >>> sleep 10 #wait a bit so if there's a real problem you don't hammer
> > >> the
> > >>> server
> > >>> done
> > >>>
> > >>>
> > >>>
> > >>>> On Fri, Jun 13, 2014 at 8:32 PM, Michael W. Hall <hallmw at att.net>
> > >> wrote:
> > >>>>
> > >>>> Ok. I have a question. I am mining BTC. Have been since
> > >> February. I
> > >>>> am running bfgminer. I have it running, but would like to improve
> > >> it.
> > >>>> When I am away from home (work or vacation), the bfgminer program
> > >> will
> > >>>> stop.
> > >>>>
> > >>>> I know I can do it just not sure how to go about it. I would like
> > >> the
> > >>>> system to check every 5 minutes or so if the bfgminer is running.
> > >> If it
> > >>>> is then do nothing. If it is not then I would like to restart. I
> > >> have
> > >>>> to start the program like so,
> > >>>>
> > >>>> bfgminer <various command line params>
> > >>>>
> > >>>> Any ideas on the best way to do this?
> > >>>>
> > >>>> Thanks,
> > >>>> Michael
> > >>>>
> > >>>> _______________________________________________
> > >>>> LUNA mailing list
> > >>>> LUNA at lunagroup.us
> > >>>> http://lunagroup.us/mailman/listinfo/luna
> > >>> -------------- next part --------------
> > >>> An HTML attachment was scrubbed...
> > >>> URL:
> > >> <http://lunagroup.us/pipermail/luna/attachments/20140613/8f743ab7/attachment.html>
> > >>> _______________________________________________
> > >>> LUNA mailing list
> > >>> LUNA at lunagroup.us
> > >>> http://lunagroup.us/mailman/listinfo/luna
> > >> _______________________________________________
> > >> LUNA mailing list
> > >> LUNA at lunagroup.us
> > >> http://lunagroup.us/mailman/listinfo/luna
> > > _______________________________________________
> > > LUNA mailing list
> > > LUNA at lunagroup.us
> > > http://lunagroup.us/mailman/listinfo/luna
> > _______________________________________________
> > LUNA mailing list
> > LUNA at lunagroup.us
> > http://lunagroup.us/mailman/listinfo/luna
>
> _______________________________________________
> LUNA mailing list
> LUNA at lunagroup.us
> http://lunagroup.us/mailman/listinfo/luna
More information about the LUNA
mailing list