• Can PuTTY create new folders for log files?

    From Francisco David del Campo Hill@21:1/5 to All on Wed Feb 10 03:29:52 2021
    Dear All,

    First time posting here, so apologies if the format of the question is unusual...

    I am using PuTTY 0.74 (Windows x64 installer), and would like it to record the output of my SSH sessions. I know how to set up the session logging settings to save the output to a file in an existing folder; for example:

    Log file name: C:\Users\me\Desktop\putty-&H-&Y&M&D-&T.log

    But I would also like to automatically classify these log files into folders by date, so I tried:

    Log file name: C:\Users\me\Desktop\PuTTY-&Y&M&D\putty-&H-&Y&M&D-&T.log

    Sadly this gave an error when I opened the SSH session:

    Error writing session log (ASCII mode) to file: C:\Users\me\Desktop\PuTTY-20210210\putty-a.b.c.d-20210210-112314.log

    It seems that PuTTY was not able to create the folder (...\PuTTY-20210210\...) before creating the log file (...\putty-a.b.c.d-20210210-112314.log). I have already tried to open PuTTY as administrator with the same result, so I doubt this is a
    permissions problem.

    Does anyone know how to make this work? Is this simply not possible with current PuTTY and should be asked as a feature request?

    Thank you in advance for your help.

    Yours,

    David

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Francisco David del Campo Hill on Wed Feb 10 16:24:50 2021
    On 2021-02-10, Francisco David del Campo Hill <frddch@gmail.com> wrote:
    Does anyone know how to make this work? Is this simply not possible
    with current PuTTY and should be asked as a feature request?

    It sounds like the directory is required to exist: all path components
    up to the file name. I'd just live with that. You already have the
    date interpolated into the name, so send the files to a common folder.

    You can have some script that runs every midnight and moves files
    into dated folders.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)