fix bug in loop which prevented last 2 rows in text log from being written
adding new command line arguments to allow more customization of backup ext