diff --git a/HealthchecksIO.py b/HealthchecksIO.py index 599db3a..138931b 100644 --- a/HealthchecksIO.py +++ b/HealthchecksIO.py @@ -1,4 +1,6 @@ -def healthcheck_ping(req_obj, url): +def healthcheck_ping(req_obj, url, start=False): + if start == True: + url + '/start' try: req_obj.get(url, timeout=10) except req_obj.RequestException as e: diff --git a/seafile-backup.py b/seafile-backup.py index 0a5128e..3a04a1c 100644 --- a/seafile-backup.py +++ b/seafile-backup.py @@ -77,6 +77,10 @@ apprise_aurls = os.getenv("apprise_aurls") apprise_title = os.getenv("apprise_title") apprise_body = os.getenv("apprise_body") +# healthcheck - Tell healthchecks.io we are starting the backup +if healthcheck: + healthcheck_ping(r, healthcheck_url, start=True) + # Stop seafile and seafile hub if docker_command: os.system(f'docker exec {container_name} /opt/seafile/seafile-serverlatest/seahub.sh stop')