Fix truncation of output file for continuous reindex script