~yerinalexey/pcrond

ref: e97d37d56b6902754318d5e0b0e2e9ca894bb35d pcrond/scripts/pcrond -rwxr-xr-x 486 bytes
e97d37d5 — Luca Vercelli easier tox 3 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()