diff options
author | doc <doc@filenotfound.org> | 2025-06-30 20:11:52 +0000 |
---|---|---|
committer | doc <doc@filenotfound.org> | 2025-06-30 20:11:52 +0000 |
commit | 41e897f4945aaf8fbcdf0b12ac2f08c5e6ae0458 (patch) | |
tree | db7c3520fd91abc3cf56b1a52095d23f3a80d059 /genesis_sync_progress.sh |
Diffstat (limited to 'genesis_sync_progress.sh')
-rwxr-xr-x | genesis_sync_progress.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/genesis_sync_progress.sh b/genesis_sync_progress.sh new file mode 100755 index 0000000..8735e0e --- /dev/null +++ b/genesis_sync_progress.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# GenesisSync Progress Tracker - No hangs, no nonsense + +SOURCE="/mnt/raid5/minio-data/linodeassets" +DEST="/assets/minio-data/mastodon" +LOG="/root/genesis_sync_progress.log" +INTERVAL=300 # in seconds + +mkdir -p $(dirname "$LOG") + +while true; do + TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S') + + SRC_COUNT=$(rclone size "$SOURCE" --json | jq .objects) + DST_COUNT=$(rclone size "$DEST" --json | jq .objects) + + if [[ -z "$SRC_COUNT" || -z "$DST_COUNT" ]]; then + echo "[$TIMESTAMP] Error getting file counts. Retrying in $INTERVAL seconds..." | tee -a "$LOG" + else + PERCENT=$(( DST_COUNT * 100 / SRC_COUNT )) + echo "[$TIMESTAMP] Synced: $DST_COUNT / $SRC_COUNT ($PERCENT%)" | tee -a "$LOG" + fi + + sleep $INTERVAL +done |