Bitcoin Forum
May 04, 2024, 07:29:52 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Possible?] Auto shutdown the node before the laptop goes to sleep? (see inside)  (Read 638 times)
mindrust (OP)
Legendary
*
Offline Offline

Activity: 3248
Merit: 2425



View Profile
July 18, 2017, 09:29:36 PM
Last edit: July 18, 2017, 09:45:07 PM by mindrust
 #1

I recently started to run a bitcoin node on my old netbook with Linux Mint 18 OS loaded. I was running a raspberry pi3 node but I sometimes get power cuts in my area and my database gets corrupted because my little pi don't have any batteries attached on it to protect itself. (nor does the USB hub which is connected to my HDD)

On the other hand my old netbook has a battery...

Is it possible to trigger
Code:
bitcoin-cli stop
command automatically before my netbook goes into sleep mode when its battery runs low?

For example; My netbook goes into sleep mode when there is %10 of the battery juice left but I want bitcoind to shut itself down when there is %15 left so it will be a super safe shut down. No fuck ups, no conflicts...

Or, Is it necessary at all?

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
1714807792
Hero Member
*
Offline Offline

Posts: 1714807792

View Profile Personal Message (Offline)

Ignore
1714807792
Reply with quote  #2

1714807792
Report to moderator
1714807792
Hero Member
*
Offline Offline

Posts: 1714807792

View Profile Personal Message (Offline)

Ignore
1714807792
Reply with quote  #2

1714807792
Report to moderator
1714807792
Hero Member
*
Offline Offline

Posts: 1714807792

View Profile Personal Message (Offline)

Ignore
1714807792
Reply with quote  #2

1714807792
Report to moderator
The network tries to produce one block per 10 minutes. It does this by automatically adjusting how difficult it is to produce blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714807792
Hero Member
*
Offline Offline

Posts: 1714807792

View Profile Personal Message (Offline)

Ignore
1714807792
Reply with quote  #2

1714807792
Report to moderator
1714807792
Hero Member
*
Offline Offline

Posts: 1714807792

View Profile Personal Message (Offline)

Ignore
1714807792
Reply with quote  #2

1714807792
Report to moderator
1714807792
Hero Member
*
Offline Offline

Posts: 1714807792

View Profile Personal Message (Offline)

Ignore
1714807792
Reply with quote  #2

1714807792
Report to moderator
TheReamer
Full Member
***
Offline Offline

Activity: 182
Merit: 100


View Profile
July 18, 2017, 09:38:57 PM
 #2

Most operating systems have features to modify actions on power low, which are you using?

For example, for w7: https://superuser.com/questions/283434/make-computer-shutdown-if-battery-50

Curated list of active & quality airdrops. Earn free crypto! http://cutt.us/airdrop
mindrust (OP)
Legendary
*
Offline Offline

Activity: 3248
Merit: 2425



View Profile
July 18, 2017, 09:41:02 PM
 #3

Most operating systems have features to modify actions on power low, which are you using?

For example, for w7: https://superuser.com/questions/283434/make-computer-shutdown-if-battery-50

It is already  stated in the OP.

netbook with Linux Mint 18 OS loaded.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
s2
Full Member
***
Offline Offline

Activity: 198
Merit: 123


View Profile
August 07, 2017, 07:11:51 PM
 #4

Could you do something like this?

Code:
battery_level=`acpi -b | grep -P -o '[0-9]+(?=%)'`
if [ $battery_level -le 10 ]
then
    bitcoind stop
fi
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
August 07, 2017, 07:44:17 PM
 #5

I recently started to run a bitcoin node on my old netbook with Linux Mint 18 OS loaded. I was running a raspberry pi3 node but I sometimes get power cuts in my area and my database gets corrupted because my little pi don't have any batteries attached on it to protect itself. (nor does the USB hub which is connected to my HDD)

On the other hand my old netbook has a battery...

Is it possible to trigger
Code:
bitcoin-cli stop
command automatically before my netbook goes into sleep mode when its battery runs low?

For example; My netbook goes into sleep mode when there is %10 of the battery juice left but I want bitcoind to shut itself down when there is %15 left so it will be a super safe shut down. No fuck ups, no conflicts...

Or, Is it necessary at all?

You could always use a command that checks if the netbook is charging, once the charger is removed, the node shuts down. Depending on how old it is, it might take mre than ~8% ttery to shutdown on (assuming it'll shutdown after 7% is left).

Else, use 25-30% just to make it safer for the node (if it's always plugged in, then you can expect the battery to start to drain as well powerwise after a few weeks/months depending on its reliability.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!