use long option name for readability
simplify md5sum calculation
truncate before restoring the backup on replication failure