def generate_crontab(current_crontab, path_to_jobs, path_to_app, unique_id):
set_disable_envar = '<STR_LIT>'<EOL>if os.environ.get('<STR_LIT>') == '<STR_LIT:true>':<EOL><INDENT>set_disable_envar = '<STR_LIT>'.format(<EOL>os.environ.get('<STR_LIT>'))<EOL><DEDENT>job_template = '<STR_LIT>''<STR_LIT>''<STR_LIT>''<STR_LIT>''<STR_LIT>''<STR_LIT>''<STR_LIT>''<STR_LIT>'<EOL>crontab = [line.strip() for line in current_crontab]<EOL>crontab = remove_existing_crontab_for_app(crontab, unique_id)<EOL>additional_crontab = []<EOL>job_number = <NUM_LIT:0><EOL>with open(path_to_jobs) as jobs:<EOL><INDENT>try:<EOL><INDENT>for job in jobs:<EOL><INDENT>parsed = parse_job_line(job)<EOL>if parsed is not None:<EOL><INDENT>job_number += <NUM_LIT:1><EOL>if skip_job(job_number):<EOL><INDENT>continue<EOL><DEDENT>schedule, collector_slug, credentials,token, performanceplatform = parsed<EOL>cronjob = job_template.format(<EOL>schedule=schedule,<EOL>set_disable_envar=set_disable_envar,<EOL>app_path=path_to_app,<EOL>collector_slug=collector_slug,<EOL>credentials=credentials,<EOL>token=token,<EOL>performanceplatform=performanceplatform<EOL>)<EOL>additional_crontab.append(cronjob)<EOL><DEDENT><DEDENT><DEDENT>except ValueError as e:<EOL><INDENT>raise ParseError(str(e))<EOL><DEDENT><DEDENT>if additional_crontab:<EOL><INDENT>crontab.append(crontab_begin_comment(unique_id))<EOL>crontab.extend(additional_crontab)<EOL>crontab.append(crontab_end_comment(unique_id))<EOL><DEDENT>return crontab<EOL>
Returns a crontab with jobs from job path

    It replaces jobs previously generated by this function
    It preserves jobs not generated by this function