Im using cronjobs to run Borgmatic. When a job finishes with any output, cron sends an email to a configured address.
I’d like to only receive logs when there’s an error. So we can output to stderr instead of stdout.
Include (sanitized) borgmatic configuration files if applicable.
Include (sanitized) --verbosity 2 output if applicable.
borgmatic version: [version here]
Use sudo borgmatic --version or sudo pip show borgmatic | grep ^Version
sudo borgmatic --version
sudo pip show borgmatic | grep ^Version
borgmatic installation method: [e.g., Debian package, Docker container, etc.]
Borg version: [version here]
Use sudo borg --version
sudo borg --version
Python version: [version here]
Use python3 --version
Database version (if applicable): [version here]
Use psql --version or mysql --version on client and server.
operating system and version: [OS here]
Thanks for filing the ticket. I’m not quite sure I’m understanding the request though. First, have you tried running borgmatic with --verbosity 0, the default? That provides no output unless there is an error. Or are you using a higher verbosity level? Can you say a little more about when you’re hoping to receive logs via cron emails, and what your use case is when you receive them?
Second, what’s the distinction between stdout and stderr that you’re making here? Doesn’t cron send email on any output, stdout or stderr?
I was in a hurry, sorry.
Seems like the —-verbosity 0 will do the job. I’ll try and reply here.
Cool, hopefully that does it! Either way, please let me know.
Seems like -v -1 does the job correctly. Thanks for the help!
Glad to hear it!
No due date set.
This issue currently doesn't have any dependencies.
Deleting a branch is permanent. It CANNOT be undone. Continue?