00:01 7th of the month => reevaluate Datastore.StorageMax $diskSize

This commit is contained in:
qo-op 2020-05-23 18:21:57 +02:00
parent aecfde52ec
commit aafd1b2104
1 changed files with 18 additions and 14 deletions

View File

@ -131,7 +131,7 @@ echo '
# / /_/ / /_/ / _ / /_/ / /
# \____/\____/ (_) \____/_/
#
# Clean & Upgrade + Log rotation + git pull + ipfs p2p port forward
# Clean & Upgrade + Log rotation + git pull + ipfs p2p port forward refresh
'
sleep $((1 + RANDOM % 5)) ### Be careful if random sleep is not activated...
############################## That swarm could become an aggressive blob !!
@ -177,26 +177,30 @@ echo '
/ /_/ __/ / / / / / / ___ / /_/ /
/___/\___/_/ /_/ /_/ /_/ |_\____/
refresh ZenTAG nano DHT
REFRESHing ZenTAG nano DHTs
'
./zen/ipns_TAG_refresh.sh
fi
##################################################################
# _____ __ __ ___
# / ___// /_____ _________ _____ ____ / |/ /___ __ __
# \__ \/ __/ __ \/ ___/ __ `/ __ `/ _ \ / /|_/ / __ `/ |/_/
# ___/ / /_/ /_/ / / / /_/ / /_/ / __/ / / / / /_/ /> <
# /____/\__/\____/_/ \__,_/\__, /\___/ /_/ /_/\__,_/_/|_|
# /____/
if [[ $dayofthemonth == 7 ]]; then
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
diskSize="$((availableDiskSize / 2))"
ipfs config Datastore.StorageMax $diskSize
echo '
_____ __ __ ___
/ ___// /_____ _________ _____ ____ / |/ /___ __ __
\__ \/ __/ __ \/ ___/ __ `/ __ `/ _ \ / /|_/ / __ `/ |/_/
___/ / /_/ /_/ / / / /_/ / /_/ / __/ / / / / /_/ /> <
/____/\__/\____/_/ \__,_/\__, /\___/ /_/ /_/\__,_/_/|_|
/____/
# 1/2 HDD for IPFS size - dicotomic adaptation 7th EVERY MONTH
#
# TODO: Read parameters from ipfs, publish status to swarm, could be use for youtube-dl or other kind of heavy ipfs input Station election.
#
'
echo "StorageMax = $diskSize"
fi
if [[ $dayofthemonth == 7 ]]; then
availableDiskSize=$(df -P ~/ | awk 'NR>1{sum+=$4}END{print sum}')
diskSize="$((availableDiskSize / 2))"
ipfs config Datastore.StorageMax $diskSize
fi