# topcron
A Cron log parser and viewer, Work In Progress !
Add the option `-L 15` to your crond daemon (for debian based distribs, see `EXTRA_OPTS` in `/etc/default/cron`), and juste run this tool.
# Links
- https://gitlab.com/thasos/topcron
- https://crates.io/crates/topcron
# Examples
```
$ topcron -f tests/sample_cron.log -u tuptime
┌─────────┬──────────┬────────┬─────────────────────┬──────────┬─────────────────────────────────────────────────────────────────────────────────┐
│ PID │ USER │ STATUS │ DATES │ DURATION │ COMMAND │
├─────────┼──────────┼────────┼─────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────────┤
│ 1025151 │ _tuptime │ OK │ 2022-03-23 14:35:01 │ 0 │ ([1025154] if [ -x /usr/bin/tuptime ]; then /usr/bin/tuptime -x > /dev/null; │
│ │ │ │ 2022-03-23 14:35:01 │ │ fi) │
├─────────┼──────────┼────────┼─────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────────┤
│ 1025451 │ _tuptime │ OK │ 2022-03-23 14:40:01 │ 0 │ ([1025452] if [ -x /usr/bin/tuptime ]; then /usr/bin/tuptime -x > /dev/null; │
│ │ │ │ 2022-03-23 14:40:01 │ │ fi) │
├─────────┼──────────┼────────┼─────────────────────┼──────────┼─────────────────────────────────────────────────────────────────────────────────┤
│ 1025743 │ _tuptime │ OK │ 2022-03-23 14:45:01 │ 0 │ ([1025754] if [ -x /usr/bin/tuptime ]; then /usr/bin/tuptime -x > /dev/null; │
│ │ │ │ 2022-03-23 14:45:01 │ │ fi) │
└─────────┴──────────┴────────┴─────────────────────┴──────────┴─────────────────────────────────────────────────────────────────────────────────┘
```
```
$ topcron -f tests/sample_cron.log -F 1025739
┌─────────┬──────┬────────┬─────────────────────┬──────────┬─────────────────────────────────────────────────────────────────┐
│ PID │ USER │ STATUS │ DATES │ DURATION │ COMMAND │
├─────────┼──────┼────────┼─────────────────────┼──────────┼─────────────────────────────────────────────────────────────────┤
│ 1025739 │ root │ OK │ 2022-03-23 14:45:01 │ 0 │ ([1025747] command -v debian-sa1 > /dev/null && debian-sa1 1 1) │
│ │ │ │ 2022-03-23 14:45:01 │ │ │
└─────────┴──────┴────────┴─────────────────────┴──────────┴─────────────────────────────────────────────────────────────────┘
```