Bitcoin Forum
November 18, 2024, 08:37:46 PM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   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 653 times)
mindrust (OP)
Legendary
*
Offline Offline

Activity: 3444
Merit: 2539



View Profile WWW
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?

▄▄███████████████████▄▄
▄███████████████████████▄
████████▀░░░░░░░▀████████
███████░░░░░░░░░░░███████
███████░░░░░░░░░░░███████
██████▀░░░░░░░░░░░▀██████
██████▄░░░░░▄███▄░▄██████
██████████▀▀█████████████
████▀▄██▀░░░░▀▀▀░▀██▄▀███
███░░▀░░░░░░░░░░░░░▀░░███
████▄▄░░░░▄███▄░░░░▄▄████
▀███████████████████████▀
▀▀███████████████████▀▀
 
 CHIPS.GG 
▄▄███████▄▄
▄████▀▀▀▀▀▀▀████▄
███▀░▄░▀▀▀▀▀░▄░▀███
▄███
░▄▀░░░░░░░░░▀▄░███▄
▄███░▄░░░▄█████▄░░░▄░███▄
███░▄▀░░░███████░░░▀▄░███
███░█░░░▀▀▀▀▀░░░▀░░░█░███
███░▀▄░▄▀░▄██▄▄░▀▄░▄▀░██
▀███
░▀░▀▄██▀░▀██▄▀░▀░██▀
▀███
░▀▄░░░░░░░░░▄▀░██▀
▀███▄
░▀░▄▄▄▄▄░▀░▄███▀
▀█
███▄▄▄▄▄▄▄████▀
█████████████████████████
▄▄███████▄▄
███
████████████▄
▄█▀▀▀▄
█████████▄▀▀▀█▄
▄██████▀▄▄▄▄▄▀██████▄
▄█████████████▄████████▄
████████▄███████▄████████
█████▄█████████▄██████
██▄▄▀▀▀▀█████▀▀▀▀▄▄██
▀█████████▀▀███████████▀
▀███████████████████▀
██████████████████
▀████▄███▄▄
████▀
████████████████████████
3000+
UNIQUE
GAMES
|
12+
CURRENCIES
ACCEPTED
|
VIP
REWARD
PROGRAM
 
 
  Play Now  
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: 3444
Merit: 2539



View Profile WWW
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.

▄▄███████████████████▄▄
▄███████████████████████▄
████████▀░░░░░░░▀████████
███████░░░░░░░░░░░███████
███████░░░░░░░░░░░███████
██████▀░░░░░░░░░░░▀██████
██████▄░░░░░▄███▄░▄██████
██████████▀▀█████████████
████▀▄██▀░░░░▀▀▀░▀██▄▀███
███░░▀░░░░░░░░░░░░░▀░░███
████▄▄░░░░▄███▄░░░░▄▄████
▀███████████████████████▀
▀▀███████████████████▀▀
 
 CHIPS.GG 
▄▄███████▄▄
▄████▀▀▀▀▀▀▀████▄
███▀░▄░▀▀▀▀▀░▄░▀███
▄███
░▄▀░░░░░░░░░▀▄░███▄
▄███░▄░░░▄█████▄░░░▄░███▄
███░▄▀░░░███████░░░▀▄░███
███░█░░░▀▀▀▀▀░░░▀░░░█░███
███░▀▄░▄▀░▄██▄▄░▀▄░▄▀░██
▀███
░▀░▀▄██▀░▀██▄▀░▀░██▀
▀███
░▀▄░░░░░░░░░▄▀░██▀
▀███▄
░▀░▄▄▄▄▄░▀░▄███▀
▀█
███▄▄▄▄▄▄▄████▀
█████████████████████████
▄▄███████▄▄
███
████████████▄
▄█▀▀▀▄
█████████▄▀▀▀█▄
▄██████▀▄▄▄▄▄▀██████▄
▄█████████████▄████████▄
████████▄███████▄████████
█████▄█████████▄██████
██▄▄▀▀▀▀█████▀▀▀▀▄▄██
▀█████████▀▀███████████▀
▀███████████████████▀
██████████████████
▀████▄███▄▄
████▀
████████████████████████
3000+
UNIQUE
GAMES
|
12+
CURRENCIES
ACCEPTED
|
VIP
REWARD
PROGRAM
 
 
  Play Now  
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!