Fixing error when printing failed to copy records

Also added additional log saving so if script fails prematurely an
incomplete log is still available.