More wrapping
This commit is contained in:
parent
209ff72416
commit
b0d915e881
1 changed files with 48 additions and 10 deletions
58
tootpaste.sh
58
tootpaste.sh
|
@ -28,8 +28,15 @@ PREV_ERRORS_LOG=/tmp/tootpaste_prev_errors
|
||||||
|
|
||||||
accounts_cull() {
|
accounts_cull() {
|
||||||
|
|
||||||
$DRY_RUN && $TOOTCTL accounts cull --dry-run --concurrency "$DB_POOL" > "$CULL_LOG"
|
$DRY_RUN \
|
||||||
$DRY_RUN || $TOOTCTL accounts cull --concurrency "$DB_POOL" > "$CULL_LOG"
|
&& $TOOTCTL accounts cull \
|
||||||
|
--dry-run \
|
||||||
|
--concurrency "$DB_POOL" \
|
||||||
|
> "$CULL_LOG"
|
||||||
|
$DRY_RUN \
|
||||||
|
|| $TOOTCTL accounts cull \
|
||||||
|
--concurrency "$DB_POOL" \
|
||||||
|
> "$CULL_LOG"
|
||||||
|
|
||||||
# Remove instances that have an expired certificate from more than
|
# Remove instances that have an expired certificate from more than
|
||||||
# TLS_EXPIRED_MAX_SEC
|
# TLS_EXPIRED_MAX_SEC
|
||||||
|
@ -55,8 +62,15 @@ accounts_cull() {
|
||||||
DATE_DIFF=$(($(date +%s) - TLS_EXPIRED_TS))
|
DATE_DIFF=$(($(date +%s) - TLS_EXPIRED_TS))
|
||||||
if [[ $DATE_DIFF -gt $TLS_EXPIRED_MAX_SEC ]]; then
|
if [[ $DATE_DIFF -gt $TLS_EXPIRED_MAX_SEC ]]; then
|
||||||
echo "${instance} has a certificate expired for more than TLS_EXPIRED_MAX_SEC, purging..."
|
echo "${instance} has a certificate expired for more than TLS_EXPIRED_MAX_SEC, purging..."
|
||||||
$DRY_RUN && $TOOTCTL domains purge --concurrency "$DB_POOL" --dry-run "$instance"
|
$DRY_RUN \
|
||||||
$DRY_RUN || $TOOTCTL domains purge --concurrency "$DB_POOL" "$instance"
|
&& $TOOTCTL domains purge \
|
||||||
|
--concurrency "$DB_POOL" \
|
||||||
|
--dry-run \
|
||||||
|
"$instance"
|
||||||
|
$DRY_RUN \
|
||||||
|
|| $TOOTCTL domains purge \
|
||||||
|
--concurrency "$DB_POOL" \
|
||||||
|
"$instance"
|
||||||
fi
|
fi
|
||||||
done < "$TLS_EXPIRED_LOG"
|
done < "$TLS_EXPIRED_LOG"
|
||||||
|
|
||||||
|
@ -86,8 +100,15 @@ accounts_cull() {
|
||||||
|| error=true
|
|| error=true
|
||||||
if $error; then
|
if $error; then
|
||||||
echo "${instance} still cannot be accessed, purging..."
|
echo "${instance} still cannot be accessed, purging..."
|
||||||
$DRY_RUN && $TOOTCTL domains purge --concurrency "$DB_POOL" --dry-run "$instance"
|
$DRY_RUN \
|
||||||
$DRY_RUN || $TOOTCTL domains purge --concurrency "$DB_POOL" "$instance"
|
&& $TOOTCTL domains purge \
|
||||||
|
--concurrency "$DB_POOL" \
|
||||||
|
--dry-run \
|
||||||
|
"$instance"
|
||||||
|
$DRY_RUN \
|
||||||
|
|| $TOOTCTL domains purge \
|
||||||
|
--concurrency "$DB_POOL" \
|
||||||
|
"$instance"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done < "$OTHER_ERRORS_LOG"
|
done < "$OTHER_ERRORS_LOG"
|
||||||
|
@ -103,13 +124,30 @@ cache_recount(){
|
||||||
|
|
||||||
media_remove(){
|
media_remove(){
|
||||||
|
|
||||||
$DRY_RUN && $TOOTCTL media remove --days "$MEDIA_REMOVE_DAYS" --concurrency "$DB_POOL" --dry-run
|
$DRY_RUN \
|
||||||
$DRY_RUN || $TOOTCTL media remove --days "$MEDIA_REMOVE_DAYS" --concurrency "$DB_POOL"
|
&& $TOOTCTL media remove \
|
||||||
|
--days "$MEDIA_REMOVE_DAYS" \
|
||||||
|
--concurrency "$DB_POOL" \
|
||||||
|
--dry-run
|
||||||
|
$DRY_RUN \
|
||||||
|
|| $TOOTCTL media remove \
|
||||||
|
--days "$MEDIA_REMOVE_DAYS" \
|
||||||
|
--concurrency "$DB_POOL"
|
||||||
|
|
||||||
$DRY_RUN && $TOOTCTL media remove-orphans --dry-run
|
$DRY_RUN && $TOOTCTL media remove-orphans --dry-run
|
||||||
$DRY_RUN || $TOOTCTL media remove-orphans
|
$DRY_RUN || $TOOTCTL media remove-orphans
|
||||||
$DRY_RUN && $TOOTCTL preview_cards remove --days "$MEDIA_REMOVE_DAYS" --concurrency "$DB_POOL" --dry-run
|
|
||||||
$DRY_RUN || $TOOTCTL preview_cards remove --days "$CARDS_REMOVE_DAYS" --concurrency "$DB_POOL" --link
|
$DRY_RUN \
|
||||||
|
&& $TOOTCTL preview_cards remove \
|
||||||
|
--days "$MEDIA_REMOVE_DAYS" \
|
||||||
|
--concurrency "$DB_POOL" \
|
||||||
|
--link \
|
||||||
|
--dry-run
|
||||||
|
$DRY_RUN \
|
||||||
|
|| $TOOTCTL preview_cards remove \
|
||||||
|
--days "$CARDS_REMOVE_DAYS" \
|
||||||
|
--concurrency "$DB_POOL" \
|
||||||
|
--link
|
||||||
}
|
}
|
||||||
|
|
||||||
statuses_remove(){
|
statuses_remove(){
|
||||||
|
|
Loading…
Reference in a new issue