renamed $tmp_name to $temp_name
improved backup library script