Problems
Like many engineers, I have a support shift. When doing so, much of the work is based around tickets. At the same time, it’s very useful to understand what changes are made for each ticket. This helps for future reference and knowledge sharing as well as understanding changes made if anything goes sideways. The question is how to do this without making it add to the burden of support.
Solution
Tmux helps in multiple ways for this by isolating commands for a given ticket and saving the commands with output to a file. The one caveat is make sure to remove any sensitive information as part of the process.
- Start a new session with tmux using the command
tmux new -s PROJ-1234
- This will isolate any commands for the particular ticket
- It will preserve the window if it is closed as well. However it will be lost if you restart or shutdown
- When you are done, you can run
name=$(tmux display-message -p '#S') && tmux capture-pane -pS - >> ~/Desktop/${name}_commands.txt 2>&1
- This will append the output from the session to a file prefixed with the session name.
- Make sure to remove any passwords, Personal Identifiable Information(PII) or other sensitive information prior to sharing it.