#211 Log file not capturing all stdout?

Закрито
9 місяці тому відкрито MKs2w7cBxTRP3e2ivnYBddxc · 5 коментарів
MKs2w7cBxTRP3e2ivnYBddxc прокоментував(ла) 9 місяці тому

What I'm trying to do and why

Put borgmatic output into log file.

Steps to reproduce (if a bug)

sudo borgmatic --verbosity 1 » borg_log.txt 2&>1

Actual behavior (if a bug)

Very minimal output ends up in the log file despite nothing printing to stdout. Basically all that ends up in the log file is that the repo + index + consistency check started and no issues were found. Would at least like to include the size before/after deduping.

borgmatic version: v1.3.5

borgmatic installation method: standlone binary from https://github.com/cmarquardt/borgmatic-binary

Borg version: 1.1.10

Python version: Python 2.7.13

operating system and version: debian 9 stretch

#### What I'm trying to do and why Put borgmatic output into log file. #### Steps to reproduce (if a bug) sudo borgmatic --verbosity 1 >> borg_log.txt 2&>1 #### Actual behavior (if a bug) Very minimal output ends up in the log file despite nothing printing to stdout. Basically all that ends up in the log file is that the repo + index + consistency check started and no issues were found. Would at least like to include the size before/after deduping. borgmatic version: v1.3.5 borgmatic installation method: standlone binary from https://github.com/cmarquardt/borgmatic-binary Borg version: 1.1.10 Python version: Python 2.7.13 operating system and version: debian 9 stretch
witten прокоментував(ла) 9 місяці тому
Власник

A couple of things:

  • Logging in borgmatic is intended to be used via a syslog daemon as described in the docs, rather than redirecting stdout/stderr. However, this feature was introduced in borgmatic 1.3.6, so you'll need to upgrade if you want to use it.
  • If you're using --verbosity 1, then that should result in borgmatic passing the --stats argument to Borg, which should cause Borg to emit the size you're looking for. Have you tried without redirection to see if it shows up at the console?
A couple of things: * Logging in borgmatic is intended to be used via a syslog daemon as described [in the docs](https://torsion.org/borgmatic/docs/how-to/inspect-your-backups/#logging), rather than redirecting stdout/stderr. However, this feature was introduced in borgmatic 1.3.6, so you'll need to upgrade if you want to use it. * If you're using `--verbosity 1`, then that should result in borgmatic passing the `--stats` argument to Borg, which should cause Borg to emit the size you're looking for. Have you tried without redirection to see if it shows up at the console?
witten додано
question / support
мітку 9 місяці тому
MKs2w7cBxTRP3e2ivnYBddxc прокоментував(ла) 8 місяці тому
Автор

Without the redirection, I see the archive + deduped size output just fine (I'm assuming this is from the underlying --stats option you spoke of). Somehow or other it doesn't get redirected properly though. I'm running debian atm. I'll try out 1.3.6 when I get a chance, but I'd like to know why redirection doesn't work if possible.

Without the redirection, I see the archive + deduped size output just fine (I'm assuming this is from the underlying --stats option you spoke of). Somehow or other it doesn't get redirected properly though. I'm running debian atm. I'll try out 1.3.6 when I get a chance, but I'd like to know why redirection doesn't work if possible.
witten прокоментував(ла) 8 місяці тому
Власник

Hmm, on a second look, the problem may be your redirection operator. I think that this:

sudo borgmatic --verbosity 1 >> borg_log.txt 2&>1

Should be this instead:

sudo borgmatic --verbosity 1 >> borg_log.txt 2>&1

Note the subtle difference in the last three characters.

Alternatively, if you're using bash, this might accomplish the same thing:

sudo borgmatic --verbosity 1 &>> borg_log.txt
Hmm, on a second look, the problem may be your redirection operator. I think that this: ``` sudo borgmatic --verbosity 1 >> borg_log.txt 2&>1 ``` Should be this instead: ``` sudo borgmatic --verbosity 1 >> borg_log.txt 2>&1 ``` Note the subtle difference in the last three characters. Alternatively, if you're using bash, this might accomplish the same thing: ``` sudo borgmatic --verbosity 1 &>> borg_log.txt ```
MKs2w7cBxTRP3e2ivnYBddxc прокоментував(ла) 8 місяці тому
Автор

Oh shoot, sorry about that! I'm pretty sure I copied the redirection operator from somewhere and have been using it in several scripts... time to fix those lol. Thanks.

Oh shoot, sorry about that! I'm pretty sure I copied the redirection operator from somewhere and have been using it in several scripts... time to fix those lol. Thanks.
witten прокоментував(ла) 8 місяці тому
Власник

No worries. I'm glad it was that simple!

No worries. I'm glad it was that simple!
Підпишіться щоб приєднатися до обговорення.
Етап відсутній
Немає виконавеця
2 учасників
Дата завершення

Термін виконання не встановлений.

Залежності

Ця проблема в даний час не має залежностей.

Завантаження…
Відмінити
Зберегти
Тут ще немає жодного змісту.