def _generate_json(gtfs_name, modify_date, gtfs_zip, json_dir, log_dir):
    _create_dir(json_dir)
    date_output_file = os.path.join(json_dir, '{}_{}.json'.format(gtfs_name, modify_date))
    _rename_existing_file(date_output_file)
    _create_dir(log_dir)
    log_path = os.path.join(log_dir, 'gtfs2json_{}_{}_{}.log'.format(gtfs_name, modify_date,
                                                                     _get_now_timestamp()))
    _progress('generating json for {}'.format(gtfs_zip))
    command = '{}/gtfs2json.py --log-file {} {} {}'.format(os.path.dirname(__file__), log_path,
                                                           gtfs_zip, date_output_file)
    _execute_command(command)

    _create_base_output_file(date_output_file, os.path.join(json_dir, '{}.json'.format(gtfs_name)))