Replies: 8 comments 18 replies
-
BTW: I've seen the raspiBackupWrapper.sh, but from there, I cannot access the variables that you uses to send the email message (subject, content...) as far as I understood. |
Beta Was this translation helpful? Give feedback.
-
Sure. Would be nice to have support for Discord (I hope you finally will provide your extension in a PR into the extensions_userprovided directory 😉 )
Right now there is support for Telegram, Slack and PushOver in raspiBackup. I frankly didn't expect so many requests for different notification targets. I think I have to start to think about a notification extension point in next release and refactor all the notification support in raspiBackup core to become a notification extension. This will take a while and I don't think we should wait for this notification extension. I remember some time ago somebody complained I removed the raspiBackup.msg file from the backup directory because he used this in some way. So now it's available again. In raspiBackupWrapper you find But I think you should instead create a post extension for Discord. That way it's easy to directly add Discord support to raspiBackup and nobody has to fiddle with the wrapper script. All extensions are called in context of raspiBackup and you can actually access - but not change - any internal variable. I don't recommend to access any internal variable because there is no guarantee the names will not change in the future but the two following two variables are exposed and you can use them:
Regarding the configuration: Please don't use the raspiBackup config file. Please check the healthcheck extension. I think that's the way you should configure your extension. Hope this answers your questions. Feel free to ask any other question if I missed to answer something. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer. Then, yes, I'm fully open to submit any code, BUT, take into consideration that:
As a conclusion: this is probably risky to use my code, that may not be valuable ;) I'll probably post here the code snipet like a stadalone shell script. Thanks and regards, |
Beta Was this translation helpful? Give feedback.
-
here is a sample code, for standalone script sending Discord JSON notification. It relies on jq to format JSON in shell, and curl to send the POST data to the webhook. to use at your own risk ;) |
Beta Was this translation helpful? Give feedback.
-
You're right. MSG_FILE is not set in an extension. That's my fault because initially I called the extensions with source but at some point in time decided not to do this because that way an extension can read but also change any variables used by raspiBackup and that's not acceptable. So I see following alternatives for you:
There are two other alternatives which require some minor change in raspiBackup
I frankly wasn't aware I disabled the possibility to access internal variables when I removed the |
Beta Was this translation helpful? Give feedback.
-
I fully agree!
Yes, this is an option, but, as you said the draw back is that it is not 'fully integrated' ni raspiBackup. Not a big deal for my own usage ;)
Not for me. I'd like to keep email too, at least as a backup of Discord ;) So, unless a change is done on raspiBackupp, and until it happens, I'll 'hard code' the MSG_FILE path/name to the proper location (I guess under home folder, according to that below)
I'm practicing from time to time (you know, once you've programming for 20y ... difficult to stop), learning Python, PHP, comming back to Shell/Linux after many years without it... etc... all that with this wonderfull Raspberry Pi, with which I did few small projects.
Thanks, this one is 'simple', but I already had hard time with it (discovering jq, some specificities with CR/LF in JSON...) Thanks again for this great work on raspiBackup and on tour efficient support! |
Beta Was this translation helpful? Give feedback.
-
Just reviewed your code. Looks pretty good to me. I also didn't know about I also created #598 right now to make sure I export some useful and missing variables for extensions and wrappers in next release. This also includes |
Beta Was this translation helpful? Give feedback.
-
I've created a new issue #599, and trying to create a DRAFT PR.
Thanks |
Beta Was this translation helpful? Give feedback.
-
Hi,
I've modified the raspiBackupp script to send Discord message at the same moment the email is sent. This is hugly and was done ONLY for testing.
I'd like to develop an extension for that, but I'm not sure how to add it properly. Could you please help me?
So far, the WebHook URL is 'hardcoded', but it would be good to have it in a config file, when I'll do it, I'll need to know if I should use the same config file or a dedicated one for this extension.
Thanks, and again, great job with this tool!
Beta Was this translation helpful? Give feedback.
All reactions