~yerinalexey/pcrond

ref: 91b72814ea86538cb6c836e4aa64321fa37df392 pcrond/scripts/pcrond -rwxr-xr-x 486 bytes
91b72814 — Luca Vercelli typo 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python

from pcrond import scheduler

crontab_filename=None

def parse_args():
    import argparse
    parser = argparse.ArgumentParser(description='Launch a crond-like daemon in userspace.')
    parser.add_argument('filename', help='the crontab file')
    args = parser.parse_args()

    global crontab_filename
    crontab_filename = args.filename

if __name__ == "__main__":
    parse_args()
    scheduler.load_crontab_file(crontab_filename)
    scheduler.main_loop()