[Feature request] Send ntfy message when synchronisation is finished

Discuss new features and functions
Posts: 13
Joined: 16 Dec 2018

update.freak

I use the docker container https://github.com/jlesage/docker-freefilesync to sync my NAS to my external HDD.
It would be nice if I could get a message when the synchronisation is successful finished, e.g.
via ntfy message.

In Python for example you I use the following code for sending notifications to my selfhosted ntfy-server on my NAS:
requests.post("https://ntfy.sh/freefilesync_example",
    data="Synchronisation finished",
    headers={
        "Authorization": "Basic TOKEN",
        "Title": "FreeFileSync",
        "Priority": "default"
    })
User avatar
Posts: 4867
Joined: 11 Jun 2019

xCSxXenon

Docker isn't officially supported, but the official versions of FFS allow running post-sync commands that can be used for whatever actions you want. You'll have to peruse the settings in Docker yourself unless someone else here has it. Otherwise, you'll have to reach out to the maintainer for such support
Posts: 13
Joined: 16 Dec 2018

update.freak

Ok, thanks.
Then it should be possible to run a post-sync Script. I will check it
Posts: 13
Joined: 16 Dec 2018

update.freak

I tried it on Windows -> there it works without problems.
Miniconda (Python is installled).
Command: python C:\Users\Beispieluser\Downloads\beispiel.py

On the docker container I tried this this
Command: python /storage/volume1/Installationsdateien/DSM/FreeFileSync_notification.py
There I got the message: /bin/sh: python: not found
So I think I should add python in the docker compose?
(When I connect directly via SSH to the NAS then it works with this command)
User avatar
Posts: 4867
Joined: 11 Jun 2019

xCSxXenon

I would guess so. The host machine having Python doesn't mean any docker containers are able to use it. That's actually kind of the point of containers, that they are completely sandboxed and standalone.
Posts: 13
Joined: 16 Dec 2018

update.freak

Ah yes, indeed.
Solved it by adding this to the container
      - INSTALL_PACKAGES=python3
      - INSTALL_PACKAGES=py3-requests
Details here: https://github.com/jlesage/docker-freefilesync/discussions/38
Posts: 13
Joined: 16 Dec 2018

update.freak

I got a replay on the github page.
Correct is the following command:
  - INSTALL_PACKAGES=python3 py3-requests