{"id":21814355,"url":"https://github.com/snawoot/flight-recorder","last_synced_at":"2025-10-29T17:46:09.355Z","repository":{"id":152607858,"uuid":"272738818","full_name":"Snawoot/flight-recorder","owner":"Snawoot","description":"Daemon which tracks system crashes and downtime duration","archived":false,"fork":false,"pushed_at":"2020-08-09T23:43:40.000Z","size":21,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T23:53:52.476Z","etag":null,"topics":["downtime","downtime-monitor","raspberry","raspberry-pi","raspberrypi","uptime","uptime-mon"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Snawoot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-16T15:03:30.000Z","updated_at":"2023-05-12T16:59:21.000Z","dependencies_parsed_at":"2023-05-26T07:31:02.483Z","dependency_job_id":null,"html_url":"https://github.com/Snawoot/flight-recorder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Snawoot/flight-recorder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snawoot%2Fflight-recorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snawoot%2Fflight-recorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snawoot%2Fflight-recorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snawoot%2Fflight-recorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Snawoot","download_url":"https://codeload.github.com/Snawoot/flight-recorder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snawoot%2Fflight-recorder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273899627,"owners_count":25187735,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["downtime","downtime-monitor","raspberry","raspberry-pi","raspberrypi","uptime","uptime-mon"],"created_at":"2024-11-27T14:37:55.335Z","updated_at":"2025-10-29T17:46:09.346Z","avatar_url":"https://github.com/Snawoot.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flight-recorder\n\nDaemon which tracks system crashes and downtime duration\n\nflight-recorder is a more portable replacement for [downtimed](https://github.com/snabb/downtimed) which also works on devices without real-time clock (like Raspberry Pi). These devices rely on network time server to set system time once network connection becomes available. For this reason precise time is not available at system startup and it doesn't allow to estimate uptime gaps right away.\n\nflight-recorder doesn't rely on any system-specific calls to get wall-clock time of system startup. Instead, each instance of flight-recorder generates unique ID of it's run (flight) and tracks it's duration with monotonic clock. Daemon keeps duration record updated in database (SQLite) and at the same time updates perceived wall-clock timestamp for it's flight ID. Once network will become available and system time is syncronized with NTP, flight record will eventually become grounded to actual wall-clock time with proper uptime boundaries. \"Flights\" may overlap if multiple instances of daemon are running at the same time.\n\n## Features\n\n* Cross-platform (Linux/MacOS/Windows/\\*BSD/whatever that can run Python)\n* Works well on devices without real-time clock (like Raspberry Pi and other mini-computers)\n* Common storage format (SQLite)\n* Doesn't hurts to device flash by rewriting same file blocks: SQLite storage backend operates in WAL mode\n* Handles overlapped uptime tracks from multiple instances\n* Can be operated by unprivileged user (both daemon and report utility)\n\n## Usage\n\nRun `flight-recorder` in background on server startup and use `flight-reports` to print reports.\n\nMake sure database path used by `flight-recorder` matches path used by `flight-reports`.\n\n## Example output\n\n```\n$ flight-reports -d /var/lib/flight-recorder/flight.db\nDOWNTIME #1: -INF =\u003e 2020-06-17 03:05:05 (INF)\n\nUPTIME #1: 2020-06-17 03:05:05 =\u003e 2020-06-17 03:15:25 (0:10:20.586976)\n\tFLIGHT #1: 2020-06-17 03:05:05 =\u003e 2020-06-17 03:15:25 (0:10:20.586976)\nDOWNTIME #2: 2020-06-17 03:15:25 =\u003e 2020-06-17 03:16:31 (0:01:05.631327)\n\nUPTIME #2: 2020-06-17 03:16:31 =\u003e 2020-06-17 04:55:17 (1:38:46.525753)\n\tFLIGHT #2: 2020-06-17 03:16:31 =\u003e 2020-06-17 04:55:17 (1:38:46.525753)\n```\n\n\n## Requirements\n\nPython 3.5+\n\n## Installation\n\nPlace scripts somewhere and just run them as you like.\n\nExample (run as root):\n\n```sh\ngit clone https://github.com/Snawoot/flight-recorder.git \u0026\u0026 \\\ncd flight-recorder \u0026\u0026 \\\ninstall flight-recorder flight-reports /usr/local/bin \u0026\u0026 \\\nuseradd -r -s /usr/sbin/nologin -m -d /var/lib/flight-recorder flight-recorder \u0026\u0026 \\\ninstall -m 0644 flight-recorder.service /etc/systemd/system \u0026\u0026 \\\nsystemctl daemon-reload \u0026\u0026 \\\nsystemctl enable flight-recorder.sevice \u0026\u0026 \\\nsystemctl start flight-recorder.service\n```\n\nDone, now you may see reports:\n\n```\nflight-reports -d /var/lib/flight-recorder/flight.db\n```\n\n\n## Synopsis\n\n```\n$ ./flight-recorder -h\nusage: flight-recorder [-h] [-i INTERVAL] [-v {debug,info,warn,error,fatal}] [-l LOG] [-d DATABASE]\n\nTracks system crashes and downtime duration\n\noptional arguments:\n  -h, --help            show this help message and exit\n\nflight options:\n  -i INTERVAL, --interval INTERVAL\n                        interval between flight record updates (default: 10.0)\n\noutput options:\n  -v {debug,info,warn,error,fatal}, --verbosity {debug,info,warn,error,fatal}\n                        logging verbosity (default: info)\n  -l LOG, --log LOG     output messages to log file instead of stderr (default: None)\n  -d DATABASE, --database DATABASE\n                        database path (default: /home/user/.flight-recorder/flight-recorder.db)\n```\n\n```\n$ ./flight-reports -h\nusage: flight-reports [-h] [-d DATABASE]\n\nReports system crashes and downtime duration\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -d DATABASE, --database DATABASE\n                        database path (default: /home/user/.flight-recorder/flight-recorder.db)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnawoot%2Fflight-recorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnawoot%2Fflight-recorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnawoot%2Fflight-recorder/lists"}