lobaro / restic-backup-docker

A docker container to automate backups with restic
Apache License 2.0
331 stars 114 forks source link

E-mail notification after backups #4

Open niondir opened 7 years ago

mrclschstr commented 4 years ago

I forked your project to fit it to my personal needs. I implemendet a simple mail notification via mailx: see https://github.com/mrclschstr/restic-backup-docker/commit/30684336fec3fa3b53fc9376d371bc78ac88ed7e (not fully tested yet).

Maybe you can gain a little inspiration from that 😃

EDIT: Well, there is still a bug in my code. It seems like you cannot pass parameters to mailx using an environment variable. Executing the command directly with the given parameters seems to work. I'm still investigating...

EDIT 2: I think I found a fix (https://github.com/mrclschstr/restic-backup-docker/commit/2e8faf39c3cba8c1bcc2045c08e6206c4fee910d#diff-185accf3472a7ada6207586b6f31a4c0R46). Not sure if using a seperate shell execution has some downsides. Any help appreciated.

niondir commented 4 years ago

Cool I will have a look into it. If you are satisfied with your solution I would also happily accept a pull request. As long if it's an optional feature that is off by default is see no risks.

mrclschstr commented 4 years ago

Creating a PR is not that easy, because I already forked your project. I'll try to find a way around that...

wuast94 commented 4 years ago

How can I setup the email notification? I see this is merged so it should work right?

mrclschstr commented 4 years ago

The readme contains an example configuration

wuast94 commented 4 years ago

I can't find it :/

mrclschstr commented 4 years ago

You have to look into the alpine branch

wuast94 commented 4 years ago

OK but the alpine branch can't rclone?

niondir commented 4 years ago

Woops, I just noticed the two branches. We should probably merge them. I will have a look.

niondir commented 4 years ago

I merged the alpine branch, since we are on alpine anyways. The integration of mailx is not as clean as it could be but should work.

I do not have time to test is yet. But if you do, I will provide a release on docker hub.

wuast94 commented 4 years ago

I will test it the next days. Can you make a docker build so that I can pull it?

niondir commented 4 years ago

@wuast94 it should be testable in "latest" tag. A new versioned tag will follow as well.

Edit: I added a new tag

dreaming-sparrow commented 2 years ago

While testing the mail feature i always receive "send-mail: applet not found" Do i need to install anything further into the container?

Solved! Postfix was missing. # apk add postfix # postfix start solved it for me!

niondir commented 2 years ago

If you can provide a PR that's very welcome.