| Crates.io | topcron |
| lib.rs | topcron |
| version | 0.1.6 |
| created_at | 2022-06-09 21:07:59.471804+00 |
| updated_at | 2023-06-07 13:13:11.074064+00 |
| description | A Cron log parser and viewer |
| homepage | |
| repository | https://github.com/thasos/topcron |
| max_upload_size | |
| id | 602878 |
| size | 92,006 |
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.
$ 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 │ │ │
└─────────┴──────┴────────┴─────────────────────┴──────────┴─────────────────────────────────────────────────────────────────┘