Added option to create reference file (-c) and force n last days to be indexed (-f n)