All pastes #410323 Raw Edit

Miscellany

public python v1 · immutable
#410323 ·published 2007-03-26 08:59 UTC
rendered paste body
  print "Archiving backup to '" + archive_path + "'..."  if archive_type == 'gz' or archive_type == 'bz2':    try:      import tarfile      tar = tarfile.open(archive_path, 'w:' + archive_type)      tar.add(backup_subdir, os.path.basename(backup_subdir))      tar.close()    except ImportError, e:      err_msg = "Import failed: " + str(e)      err_code = -2    except tarfile.TarError, e:      err_msg = "Tar failed: " + str(e)      err_code = -3