Use stdout instead of stderr for logs #248
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#248
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
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.
Steps to reproduce (if a bug)
Include (sanitized) borgmatic configuration files if applicable.
Actual behavior (if a bug)
Include (sanitized)
--verbosity 2
output if applicable.Expected behavior (if a bug)
Other notes / implementation ideas
Environment
borgmatic version: [version here]
Use
sudo borgmatic --version
orsudo pip show borgmatic | grep ^Version
borgmatic installation method: [e.g., Debian package, Docker container, etc.]
Borg version: [version here]
Use
sudo borg --version
Python version: [version here]
Use
python3 --version
Database version (if applicable): [version here]
Use
psql --version
ormysql --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!