How to use the crontab.save_crontab function in crontab

To help you get started, we’ve selected a few crontab examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla / telemetry-server / http / analysis-service / server.py View on Github external
def update_crontab(jobs=None):
    if jobs is None:
        jobs = []
        for job in get_jobs():
            jobs.append(job)
    new_crontab = crontab.update_crontab(jobs)
    if app.config['DEBUG']:
        print "Debug mode, would have updated crontab to:"
        print new_crontab
    else:
        crontab.save_crontab(new_crontab)