sudo mysql AB_FORUMS -e 'select id from posts where topic_id = 90965;' | tail -n +2 > pids.txt

for PID in `cat pids.txt`; do
#	echo === $PID ===
	for F in ./attaches/*/*/*$PID*; do
		if [ -e $F ]; then
			echo $F
			D=`dirname $F`
			mkdir -p ./hidden/$D
			mv $F ./hidden/$D
		fi
	done
done