Fix backup conditions

This commit is contained in:
localhost_frssoft 2022-04-14 13:48:58 +03:00
parent 792ce471f0
commit c5d64e621e

View file

@ -147,7 +147,9 @@ follow_api_export()
while [ $count -gt 0 ]; do
followings=$(followings_api_get $acc_id)
count=$(echo $followings | jj \#)
if [ $count -lt 40 ]; then
if [ $count -eq 0 ]; then
echo "$acc_following_count followings exported"
elif [ $count -lt 40 ]; then
countindex=$(expr $count - 1)
echo $followings | jj -l \#.acct | sed 's/"//g' | legacy_addr_preprocess >> backups_$instance/friends.csv
offset=$(echo $followings | jj $countindex.id)
@ -159,8 +161,6 @@ follow_api_export()
echo $followings | jj -l \#.acct | sed 's/"//g' | legacy_addr_preprocess >> backups_$instance/friends.csv
offset=$(echo $followings | jj $countindex.id)
echo "+$count follows"
else
echo "$acc_following_count followings exported"
fi
sleep 1
done
@ -173,7 +173,9 @@ blocks_api_export()
while [ $count -gt 0 ]; do
blocks=$(blocks_api_get)
count=$(echo $blocks | jj \#)
if [ $count -lt 40 ]; then
if [ $count -eq 0 ]; then
echo "Blocks exported"
elif [ $count -lt 40 ]; then
countindex=$(expr $count - 1)
echo $blocks | jj -l \#.acct | sed 's/"//g' | legacy_addr_preprocess >> backups_$instance/blocks.csv
offset=$(echo $blocks | jj $countindex.id)
@ -184,8 +186,6 @@ blocks_api_export()
echo $blocks | jj -l \#.acct | sed 's/"//g' | legacy_addr_preprocess >> backups_$instance/blocks.csv
offset=$(echo $blocks | jj $countindex.id)
echo "+$count blocks"
else
echo "Blocks exported"
fi
sleep 1
done
@ -198,7 +198,9 @@ mutes_api_export()
while [ $count -gt 0 ]; do
mutes=$(mutes_api_get)
count=$(echo $mutes | jj \#)
if [ $count -lt 40 ]; then
if [ $count -eq 0 ]; then
echo "Mutes exported"
elif [ $count -lt 40 ]; then
countindex=$(expr $count - 1)
echo $mutes | jj -l \#.acct | sed 's/"//g' | legacy_addr_preprocess >> backups_$instance/mutes.csv
offset=$(echo $mutes | jj $countindex.id)
@ -209,8 +211,6 @@ mutes_api_export()
echo $mutes | jj -l \#.acct | sed 's/"//g' | legacy_addr_preprocess >> backups_$instance/mutes.csv
offset=$(echo $mutes | jj $countindex.id)
echo "+$count mutes"
else
echo "Mutes exported"
fi
sleep 1
done