Closed TonyBrobston closed 6 years ago
Looks like I can use tee
and I will write the output of rip.sh
to /var/log/makemkv.log
. On error I can likely grab this file and dump it to an email (or possibly attach it as a document, might be nice to opening the file in a specific application on a smart phone..?)
Tested happy path. I received an email on a successful rip. I also tested the sad path for when low_space_term
is invoked; I also received an email.
I'm not sure how to test on_err
and catch_failed
. I should have also tested the same docker container but without the three environment variables I added EMAIL
, etc.
I'm going to continue to use the image I built locally. If you decide you want to collaborate on some changes, just lemme know.
Working on a solution that sends email notifications on success/failure. I will likely iterate a few times on this idea.
I haven't had a chance to test out my current changes with the actual hooks. I manually tested the email function.
In future iterations I would like to embed the send_email function somewhere in the rip script and not install the AWS CLI unless
EMAIL
,AWS_ACCESS_KEY_ID
, andAWS_SECRET_ACCESS_KEY
are all passed in as environment variables. Not sure if this will mean that I callsudo apt install -y awscli;
(well, whichever variant for this flavor of linux; dnf?) to install... or possibly I could do docker-in-docker and find a docker image that has the AWS CLI installed and call into that.Another goal is to put the logs in the email on failure. I know that outside the container I can run
docker logs [cid]
to get the logs, but I'm not sure what command to run inside the container to get the same output. Once I figure this out, getting the logs into the email on failure should be easy.The biggest downside to adding this feature is setting up an AWS account. However, I personally want more experience with AWS, so it's a plus for me.