ReneSmeekes / storj_earnings

Earnings calculation script for Storj V3 storagenodes
109 stars 23 forks source link

sh script Linux #9

Open katelinlis opened 4 years ago

katelinlis commented 4 years ago

/mnt/storj - Link to storj data folder ./storjTemp/ - Temp folder for db

docker stop -t 300 storagenode

mkdir storjTemp
cp /mnt/storj/storage/bandwidth.db  ./storjTemp/bandwidth.db
cp /mnt/storj/storage/storage_usage.db  ./storjTemp/storage_usage.db
cp /mnt/storj/storage/piece_spaced_used.db  ./storjTemp/piece_spaced_used.db
cp /mnt/storj/storage/reputation.db  ./storjTemp/reputation.db

docker start storagenode
wget https://raw.githubusercontent.com/ReneSmeekes/storj_earnings/master/earnings.py
python earnings.py ./storjTemp
rm -rf ./storjTemp
centrd commented 3 years ago

Is it really necessary to stop the node and create a temp copy on Linux?

ReneSmeekes commented 3 years ago

It isn't. Database corruption can happen on windows and mac os with docker because it uses network shares and virtualization in the background to share the volumes with the container. On linux this isn't the case, so the databases aren't at risk.

That said, it's a use at your own risk situation. But I run this script without ever stopping my node myself on linux.

centrd commented 3 years ago

Gotcha. Thanks for confirming. I've been running the script on my Linux node without stopping the container, and so far everything has been fine, but this got me wondering. I try to limit node restarts to updates and maintenance only.

EDIT: Fantastic work, by the way.