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... sleep $((1 + RANDOM % 5)) ### Be careful if random sleep is not activated...
############################## That swarm could become an aggressive blob !! ############################## 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 ./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 # 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. # 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 fi