Handle an error writing the backup file
Close the file after writing