def backup_final_init(rpout): """Open the backup log and the error log, create increments dir""" global prevtime, incdir if Log.verbosity > 0: Log.open_logfile(Globals.rbdir.append("backup.log")) checkdest_if_necessary(rpout) prevtime = backup_get_mirrortime() if prevtime >= Time.curtime: Log.FatalError( """Time of Last backup is not in the past. This is probably caused by running two backups in less than a second. Wait a second a try again.""") ErrorLog.open(Time.curtimestr, compress = Globals.compression) if not incdir.lstat(): incdir.mkdir()
def cleanup(): """Do any last minute cleaning before exiting""" Log("Cleaning up", 6) if ErrorLog.isopen(): ErrorLog.close() Log.close_logfile() if not Globals.server: SetConnections.CloseConnections()