def backup_localy(environment, local_settings, name, query_set_class=None):

    if 'backup_dir' not in local_settings:
        exit_with_message('Local Settings not configured correctly, expecting "backup_dir"')

    backup_dir = local_settings['backup_dir']

    if not os.path.isdir(backup_dir):
        exit_with_message('Directory [{}] does not exist.  Exiting ...'.format(backup_dir))

    dump_path = dump_db(environment, QuerySet=query_set_class)
    zipf = zipdir(dump_path)

    unique_file_path = generate_unique_name(backup_dir, environment, name)

    shutil.move(zipf.filename, unique_file_path)
dataset/ETHPy150Open monarch-org/monarch/monarch/local.py/backup_localy/original