~yerinalexey/pcrond

ref: 1d4b23d9a60c5b2340226d1d7525563822941c48 pcrond/pcrond.py -rwxr-xr-x 486 bytes
1d4b23d9 — Luca Vercelli made executable 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/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()