I recommend using tmux, this way you can reconnect to the session running rebuild even if your client times out.
tmux