Python Forum
looking 4 py code: commang logger - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Forum & Off Topic (https://python-forum.io/forum-23.html)
+--- Forum: Bar (https://python-forum.io/forum-27.html)
+--- Thread: looking 4 py code: commang logger (/thread-1408.html)



looking 4 py code: commang logger - Skaperen - Dec-31-2016

i have already implemented one of these in bash.  it's kinda big and awkward (no, it doesn't use awk).  it does use the script command for the terminal environment.  it names the log file with a date and time. there are options: -s to add a suffix to the name, -p to add a prefix to the name, -d to put the log file in a specified directory, and -f to specify a full file name.  the options precede the command to be run and logged (both stdout and stdin).  what else do you think this could use for features and/or options (in case i re-implement this in python3)?


RE: looking 4 py code: commang logger - wavic - Dec-31-2016

This can be done with the linux audit system but I never used it.

Have you seen ttyrec? It's on top of script

On the question... Except of logging, sharing the sessions ( with educational purpose ) I can not think of anything else right now


RE: looking 4 py code: commang logger - Skaperen - Dec-31-2016

ttyrec is in C.  i want to do it in Python3.

i have used my own logcmd, the one i wrote in bash many years ago, a few times today. one of them was running my weekly scripted rsync backup.  maybe i should redo that in Python3 soon.