Skip to content

Commit 85de8e4

Browse files
Merge pull request #56 from cz3k/master
Add support for Uptime Kuma push monitor
2 parents 2b0ebc8 + 81821f2 commit 85de8e4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Mount your backup directory as `/var/backups` (or override `$BACKUP_DIR`). Backu
1919

2020
Backups run daily at midnight. To change this, add a cron-style schedule to `$SCHEDULE`. For more information on the format of the cron strings, please see the [croniter documentation on PyPI](https://pypi.org/project/croniter/).
2121

22-
Additionally, there is support for [healthchecks.io](https://healthchecks.io). `$HEALTHCHECKS_ID` can be used to specify the id to ping. If you're using a self-hosted instance, set `$HEALTHCHECKS_HOST`.
22+
Additionally, there is support for [healthchecks.io](https://healthchecks.io) and [Uptime Kuma](https://github.com/louislam/uptime-kuma/) for monitoring purposes. `$HEALTHCHECKS_ID` can be used to specify the id to ping. If you're using a self-hosted instance, set `$HEALTHCHECKS_HOST`. To use the generated URL by the Monitor Type `Push` in Uptime Kuma, set `$UPTIME_KUMA_URL`.
2323

2424
Files are backed up uncompressed by default, on the assumption a snapshotting or native compressed filesystem is being used (eg ZFS). To enable compression, set `$COMPRESSION` to one of the supported algorithms:
2525

db-auto-backup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ def backup(now: datetime) -> None:
194194
data="\n".join(backed_up_containers),
195195
).raise_for_status()
196196

197+
if uptime_kuma_url := os.environ.get("UPTIME_KUMA_URL"):
198+
requests.get(uptime_kuma_url).raise_for_status()
199+
197200

198201
if __name__ == "__main__":
199202
if os.environ.get("SCHEDULE"):

0 commit comments

Comments
 (0)