#!/bin/sh # Move statuses to acct dirs # [statuses] # | # |---[acct] # | | # | |--- [status_id] # | |--- ... # |... for i in "$main_basedir"/statuses/$instance/*/*.json; do status_id=$(jj -i $i 'id') acct=$(jj -i $i 'account.acct') mkdir -m 711 -p "$main_basedir"/statuses/$instance/$acct if [ -n "$status_id" ]; then mv "$main_basedir"/statuses/$instance/$status_id "$main_basedir"/statuses/$instance/$acct fi done