~yerinalexey/pcrond

ref: 82dc2199e5ccefd5917f720c5426e560ccab3e5c pcrond/scripts/pcrond -rwxr-xr-x 711 bytes
82dc2199 — Alexey Yerin fix: drop logging 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python

VERSION = "1.0"

def parse_args():
    import argparse
    parser = argparse.ArgumentParser(description='Launch a crond-like daemon in userspace.')
    parser.add_argument('-r', '--crontabfile',
                        help='the crontab file (default ~/.local/crontab)',
                        default='~/.local/crontab')
    parser.add_argument('-v', '--version', action='store_true', help='print version then exit')
    args = parser.parse_args()
    return args

if __name__ == "__main__":
    args = parse_args()
    if args.version:
        print(VERSION)
        exit(0)

    from pcrond import scheduler
    scheduler.load_crontab_file(args.crontabfile)
    scheduler.main_loop()