New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output to /dev/tty #69

Closed
christianTF opened this Issue Sep 11, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@christianTF
Copy link

christianTF commented Sep 11, 2018

Hi again,

it took me some time, tests, and finally code review to figure out, that your output is sent to /dev/tty.
Also it is tricky to capture that output from tty.

Is there a special reason to not use stderr or stdout?

cu, Christian

@framps framps self-assigned this Sep 12, 2018

@framps

This comment has been minimized.

Copy link
Owner

framps commented Sep 12, 2018

Well, that's something I coded in the early development stage of raspiBackup. As far as I remember it was somehow related to the fact that the output is written in parallel into the log.

What's your exact use case? I guess you want to pipe the output somewhere in your code when invoking raspiBackup. @christianTF Please confirm.

I will check whether I can change the code to use stdout and stderr for all messages.

@christianTF

This comment has been minimized.

Copy link
Author

christianTF commented Sep 12, 2018

As the LoxBerry uses native logging facilities with live web logviewer, I tried to pipe the output directly to the LogBerry logging instead of copying it after the backup.

Finally I found the tool script —command raspiBackup.sh ... that captures tty and send it to my file.

This is a working solution where I don’t require any adaption/feature. It too would be compatible with stdout in the case you are thinking of a modification.

I was just asking because I’ not familiar with tty output.

Cheers, Christian

@christianTF christianTF reopened this Sep 12, 2018

@framps

This comment has been minimized.

Copy link
Owner

framps commented Sep 12, 2018

Glad you found a solution for your issue. I suggest to create an issue first next time you face some strange behavior of raspiBackup before spending time to find a workaround 😉.

Usage of tty does not comply to standard io handling of programs. I frankly didn't care about this in early development stages. But you put a valid issue on the table. I found out it's not that difficult to redirect I&W messages into stdout and E messages into stderr.

sudo ./raspiBackup.sh -l debug -L current 1>stdout.log 2>stderr.log

works already in a prototype. Is this what you are looking for and will help you to get rid of your workaround?

I keep you posted in this issue when there is a fix available. I will roll in this fix in next release and then it's up to you whether you want to stick with your workaround or use stdout and stderr.

@christianTF

This comment has been minimized.

Copy link
Author

christianTF commented Sep 19, 2018

This looks good and familiar :-)

I'll stick on this issue, and will test it as soon as you have a release with the change.

@framps

This comment has been minimized.

Copy link
Owner

framps commented Sep 19, 2018

Glad to hear that's what you need 😄

This feature is already available in the development branch which will become the next release. Feel free to grab the code and test right now. Please note: The development branch includes all issues marked as fixed in next release and thus includes fixes for your two other issues you created 😄

@framps framps closed this Jan 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment