~yerinalexey/pcrond

ref: eed0f60f0e0f51069afc4c666fb64f1a281afcb8 pcrond/pcrond.py -rw-r--r-- 486 bytes
eed0f60f — Luca Vercelli update 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()