Open fluffig opened 1 year ago
Hello! I'd confirm the issue as not an enhancement but as a bug.
My settings to store all sessions and avoid overlapping or overwritting are:
close terminal on disconnect: ''
save session logs: 1
session log pattern: <UUID>_<NAME>_<DATE_Y><DATE_M><DATE_D>_<TIME_H><TIME_M><TIME_S>.txt
I've just recognized that: 1) when I've disconnected a ssh or local terminal session with Ctrl+D, or ssh session timed-out, or a remote node get rebooted 2) and session reconnected in the same window/tab by ENTER key 3) then already saved session log reopened to write with the same name and inode, get completely cleared and rewritten with new data received after the session restart.
That is really sad because lost of all session logs, e.g. with troubleshooting and configuration, followed by remote system restart... Only final checks after a remote system restoration left in the log files.
I expected that asbru-cm on a reconnect of a session within the same window/tab will log followed session data in either of two ways: a) will append to end of already existing log file (the same way as it appears on a screen) if filename composed of the window/tab initial creation timestamp; b) will create a new log file with a name based on time of session restart.
Many thanks for your great Asbru-CM!
Is your feature request related to a problem? Please describe. Often I have to close a connection (i.e. exit from remote shell) but leave the session tab open to get back later. When "resuming" the session, the already existing logfile gets overwritten by the new one. So I have to open a new session tab for this connection to have it write into a new logfile. I'd better like to have asbru write to a new logfile when re-opening a closed session.
Describe the solution you'd like When re-opening an existing session asbru should open a new logfile for this new session.
Describe alternatives you've considered Never re-opening a closed session but always opening a new session tab.
Additional context I'm not talking about appending to an existing logfile, as described in #760 . Also it's not about logging multiple sessions (i.e. tabs) to the same logfile. I want each session to generate a unique logfile. My usual logfile naming is
<NAME>_<DATE_Y><DATE_M><DATE_D>_<TIME_H><TIME_M><TIME_S>.txt
. So for me, I want to have separate logfiles for each connection. I do have to work a lot with multiple open sessions to different hosts. As a sysadmin I always have to do some tasks here and there and sometimes (not really sometimes, it's quite usual) I get some urgent tickets and have to switch to another host. As time goes by, day is over I want to go home and as a reminder I leave those session tabs opened for the next day. I'm not quite sure but I think it was possible to just hit enter key, re-open the session and have a new logfile for this session. But actually this doesn't work and the old logfile gets overwritten. Life would be a bit easier for me, when I could do just that: Have a tab with a closed session, hit enter and just go on working where I left it. Another point which is more error prone is following: I have a ssh connection opened, switch to another tab/window/coffee, get back to that connection and don't realize quick enough that it has been closed by remote side meanwhile. So entering blindly a command, hitting enter .... et voilá: A new session starts, overwriting the existing logfile. A third point: Having some kind of write protection for an already closed logfile, at least within asbru, would make this software more compliant when it comes to traceability. So in best case the user could activate a checkbox in the settings and asbru would never overwrite an existing logfile but always open a new one or appending to an existing one (could be determinded by naming convention).And by the way: Thank you for keeping up the work on this really great piece of software!! :smile: I used to work with pac for a long time and I was so happy seeing that the software was not abandoned! :+1: