Saving Terminal output to dated log file.

Joined
Jun 23, 2012
Messages
166
Reaction score
5
Points
18
MAC friends,

How can I auto save my terminal output to a log file, aka like Putty does. (within consideration as putt can actually include the profile name etc)

Thinking a on open script, that receives all output as it happens, with the file name appended with the date the file was created, thus preventing 2 terminal sessions writing to the same file.

Not finding what I'm looking for via Google.

G
 
Joined
Sep 8, 2007
Messages
552
Reaction score
4
Points
18
Location
United Kingdom
Your Mac's Specs
13" MBP 2.3Ghz i7 32GB 1TB | iPhone XR
What about using an alternative to Terminal?

I use iTerm instead of the built in OSX Term: https://www.iterm2.com BTW its free.

They have the option to output log files built in.
 
Joined
Sep 8, 2007
Messages
552
Reaction score
4
Points
18
Location
United Kingdom
Your Mac's Specs
13" MBP 2.3Ghz i7 32GB 1TB | iPhone XR
Screen Shot 2016-06-21 at 18.42.33.png

See under Misc settings.
 
OP
georgelza
Joined
Jun 23, 2012
Messages
166
Reaction score
5
Points
18
Ignore my last question, found this screen in iTerm.

Edit: does the Automatically log session directory take a tag like %d%m%Y so that you can date stamp it, or does it append for a profile to the same file,

wondering what happens if I open multiple sessions to the same server using the stored profile. If they wrote to the same log file it would cause some interesting head scratching when/if the log files are viewed later.

G
 
OP
georgelza
Joined
Jun 23, 2012
Messages
166
Reaction score
5
Points
18
... stupid question, where do I save connections/profiles, so that I can double click a connection definition and have it open it.

At the moment I use JellyfiSSH for that, I've tried telling iTerm to now be my default TERM hoping JellyfiSSH would then open iTerm but not so lucky. ;)

G
 
OP
georgelza
Joined
Jun 23, 2012
Messages
166
Reaction score
5
Points
18
IGNORE
Just noticed in the stored directory, just after the date stamp is the profile name - happiness

... think I'e figured out, a Profile is a stored connection, and I can place the ssh <username>@<IP> in the Command line.
This now makes me wonder, in the Sessions tab, where you define the place log files directory, can you share a directory between Profiles but have all files from one profile be tag-started with a word, like the profile name via something like %profile ?

G
 
Last edited:

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top