Bitcoin Forum
May 26, 2024, 04:17:59 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 3 4 5 [6] 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 »
101  Bitcoin / Bitcoin Discussion / Re: How to repeat the same command automatically in Linux? on: March 04, 2018, 01:56:27 PM
If the command pgrep exists, try this:
Code:
#!/usr/bin/bash
if [[ ! $(pgrep -f "rtgferfd.py") ]]; then
echo "Bot down"
python rtgferfd.py --solid --r --fr --quantity 35 --wait_time 34 &
fi

If not, this:
Code:
#!/usr/bin/bash
if [ "$(ps ax | grep "rtgferfd.py" | grep -vc grep)" -eq "0" ]; then
echo "Bot down"
python rtgferfd.py --solid --r --fr --quantity 35 --wait_time 34 &
fi

Make sure you use full paths though, or you might run into troubles with restarting.
This script should run fine via cron. Put it into a file and tell cron to run it eg every minute.
Try it manually first: name it test.sh or whatever you want to call it and execute it.
If your bot is running, you should see not output. If it is not, your bot should appear in the processlist afterwards.


You`re awesome!
I`ll try to see if it`ll work like this!
Thank you very very much!
102  Bitcoin / Bitcoin Discussion / Re: How to repeat the same command automatically in Linux? on: March 04, 2018, 01:15:42 PM
The confusing thing is

1- Should I create a file and name it test.sh and then put this in cron job? Will that just work like that?
2- Process name shows as just python. But what I write in terminal is like
Code:
python rtgferfd.py --solid --r --fr --quantity 35 --wait_time 34
103  Bitcoin / Bitcoin Discussion / Re: How to repeat the same command automatically in Linux? on: March 04, 2018, 12:44:13 PM
Well sure it does. You get a new pid assigned every time.
When you check it and see that it's not running, then your watchdog script just needs to run the command which starts your bot again after it crashed.

If your bot is running as a service, you might want to look into systemd; afaik you can set in a unit file that it automatically restarts a service.


I don`t think I explained it right.
When I run the script now the PID is 23423 and the script I will run on cron is going to be like waht you wrote above. But when I`m not around and the script dies. Your code will look for that PID but that PID will disappear and wont exist anymore.

So how can your code run a script automatically when the PID changes every time it runs?

What am I going to write at this part of your code exactly?
Code:
"pidof myprocess" 
104  Bitcoin / Bitcoin Discussion / Re: How to repeat the same command automatically in Linux? on: March 04, 2018, 09:31:02 AM
I tried the PID method but PID changes everytime it runs
105  Bitcoin / Bitcoin Discussion / Re: How to repeat the same command automatically in Linux? on: March 04, 2018, 06:38:19 AM
Are you talking about writing a script that repeats the most recent command in case of a failure?

That`s exactly what I`m looking for. Anytime it comes back to the command line, it should repeat the same command that previously just ran

Depending on your setup you either want to have a utility like daemontools watch the process and restart it on a crash:

https://unix.stackexchange.com/questions/336501/how-to-restart-a-process-automatically-when-it-killed-in-linux-centos


Or add a loop to your script that retries the same command until it succeeds:

https://serverfault.com/questions/80862/bash-script-repeat-command-if-it-returns-an-error
https://stackoverflow.com/questions/12321469/retry-a-bash-command-with-timeout

In case you're new to shell scripting: When an application (or command) runs successfully it returns a status code = 0; if it fails it returns a nonzero error code. These loops retry the same command with a slight delay inbetween (sleep) until it returns the status code = 0, ie. succeeds.


Ok. I`m a little confused now. I`m still very much of a n00b in Linux

I`ve been trying this daemontools thing but I couldn`t figure out how to install it on Debian or if it comes in default already.

So I moved to the other links you sent but they`re all in different codes and I`m not sure what to do with them. My script is in Python and it keeps running until sometimes it gives and error and close itself. I just want it to start again with the same command when it closes. So should I add those codes in the python files? if so which file?
or should I create a new file and add it to the scripts folder or something?

I`d really appreciate it if you can explain step by step what to do. I desperately need this

Thank you
106  Economy / Currency exchange / WTS Bitcoin Private BTCP on: March 04, 2018, 02:15:34 AM
Each for 0.08 BTC
Let me know if interested

Either you send first or we do an open trade in Bitcointalk or you cover the fees of an escrow we both agree on
107  Economy / Currency exchange / Re: Trading 6399 SEM for 0.000165btc each with BTC Turkiye on: March 02, 2018, 09:56:30 AM
We can use an escrow service for this trade.

SOLD!!!

Dude, I don`t care how much of a scammer you`re but WTF you`re doing in my thread where I completed a deal with a person and it should be closed now. Go open your own thread and ask people to send you money there.
108  Bitcoin / Bitcoin Discussion / Re: How to repeat the same command automatically in Linux? on: March 01, 2018, 07:10:27 PM
Usually you can use the arrow keys up / down to navigate through your command history, if that's what you're looking for. This is true for both Linux and Windows machines. Or are you talking about writing a script that repeats the most recent command in case of a failure?

Love your Motto BTW Cheesy
Awesome!
109  Economy / Economics / Best Virtual Bitcoin Tax Person / Accountant on: March 01, 2018, 05:53:39 PM
Any advises on which company/person is the best for US taxes? I need a person/company to do my and my companies taxes and I`d like to keep them as my future accountants/CPAs as well. I definitely need a person who`s an expert of Crypto world and well experienced in his field where he knows all ins and outs so they can maximize our return and stay working with us for years.

So anyone knows some names?
110  Bitcoin / Bitcoin Discussion / Re: How to repeat the same command automatically in Linux? on: March 01, 2018, 10:07:36 AM
Are you talking about writing a script that repeats the most recent command in case of a failure?

That`s exactly what I`m looking for. Anytime it comes back to the command line, it should repeat the same command that previously just ran
111  Bitcoin / Bitcoin Discussion / Re: How to repeat the same command automatically in Linux? on: March 01, 2018, 09:59:43 AM
No one can help me on this?
112  Bitcoin / Bitcoin Discussion / How to repeat the same command automatically in Linux? on: March 01, 2018, 01:48:34 AM
I have a bot which gives an error sometimes and cancels the process then I`ll have to the run command again to re-start the bot.

Is there anyway to automatically re-run the same previous command if the process is cancelled and it goes back to the main terminal command line again?

I use Debian

Thank you in advance for any help
113  Bitcoin / Bitcoin Discussion / Block Alert? on: February 28, 2018, 11:58:14 AM
Is there a website that sends you a notification when a specific block has been produced/mined/confirmed?

I`d like to get a notification, when let`s say 511389 block has appeared in Blockchain but I couldn`t find anything from a google search
114  Bitcoin / Bitcoin Discussion / Re: There goes all my Bitcoin Pizzas (BPAs) on: February 22, 2018, 09:24:42 AM
Can a mod please move this to the right topic as I couldn`t find the right category it should be in but I don`t think discussion is the right one
115  Bitcoin / Bitcoin Discussion / Re: There goes all my Bitcoin Pizzas (BPAs) on: February 22, 2018, 08:41:08 AM
I tried the options you told me already. It keeps giving me the same error
116  Bitcoin / Bitcoin Discussion / There goes all my Bitcoin Pizzas (BPAs) on: February 22, 2018, 07:36:34 AM
I had created an account in HB.top and verified everything accept the phone number because it kept saying the form of the number is wrong
Today I transferred all my Bitcoin Pizzas (BPAs) to make some transactions but It doesn`t let me do anything because it doesn`t accept my transaction password and It keeps asking for my phone number verification.

So it seems like my account is stuck.

Anyone knows what is the format to put my phone number there to be verified as it keeps saying "Form of mobile number is wrong" ?

This is the screenshot of the Chinese version in case if someone can translate it and find out the problem



https://i.imgur.com/W0jgZgi.png
117  Alternate cryptocurrencies / Marketplace (Altcoins) / Bitcoin Parallel (BCP and BCPC) For Sale on: February 22, 2018, 03:52:29 AM
Open for offers

Seems like a pretty solid well English speking project https://www.bitcoinparallel.org/
118  Bitcoin / Bitcoin Discussion / Re: Bitcoin Holocaust? WTF? on: February 19, 2018, 05:43:24 AM
Old story junk:
https://bitcointalk.org/index.php?topic=2469155.0

You've already missed not only the birth but also the death of this shitcoin

Haha...
I`d make some political statement now but It`s ok. It`s already dead Cheesy
119  Bitcoin / Bitcoin Discussion / Bitcoin Holocaust? WTF? on: February 19, 2018, 05:38:17 AM
Is this seriously true?
Is it a real fork?

and Why the hell is it called Holocaust?

http://www.bitcoinholocaust.org/

PS: I still want my free coins if there`s an airdrop Cheesy
120  Economy / Currency exchange / Re: WTS LBTC (Lightning Bitcoin) for 0.04 BTC Each on: February 16, 2018, 07:38:10 PM
Btcdiv.com indicates that it is being traded on btctrade.im, ZB.com, EXX.com and Coinegg.com, although none of them allow deposits yet.  People are just trading what they got from having BTC in the exchange at the time of the fork.

True. I confirmed that too. That`s why I`m trying to sell mine because this is the only way for people to buy LBTC and keep it in their wallet right now
Pages: « 1 2 3 4 5 [6] 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!