Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
newbie logging
Name: mike Date: May 1, 2003 at 09:48:34 Pacific OS: sun CPU/Ram: sun
Comment:
I'm trying to get the date and error message to show up in a log file on the same line. Can anyone help?
Name: David Perry Date: May 1, 2003 at 10:30:41 Pacific
Reply:
Is "/opt/Omnibus/log" a directory ? Does the user executing this script have write permissions to that directory ? Is "/opt/Omnibus/log/probe.log" a file under that directory that the user has write priviledges to ?
0
Response Number 2
Name: Don Arnett Date: May 2, 2003 at 15:27:19 Pacific
Reply:
A little more specificity and less seemingly irrelevant detail would be helpful.
Assuming that the real question is how to write both a date and error message on the same line to a log file, generally speaking, do the following:
echo `date` error message > logfilename
or
echo "`date` error message" > logfilename
or possibly you'll want to use >> so that the line is appended to the file
NOTE that the quotes around "date" are backward quotes. This causes the date command to be run and the output of the command to be use by the echo command (meaning the date will be output to the file).
Summary: Greetings, I have a PERL monitoring script that telnets to my E10K domains and it is executed from m a WIN 2000 server. The error is "Oct 19 03:11:01 grouper telnetd[372]: [ID 682499 daemon.info] ttlo...
Summary: I have a SunOS 5.7 and 3 PC that with W2K that telnet to the Server i've been losing my telnet sessions, for the past three days, it's like on and off, and i'm trying to determin what wrong, is it m...
Summary: Hi, I am running a Korn script on a Solaris box. I would however like to execute some scripts on a Linux box by remotely logging in (as a part of my korn script) non interactively i.e. the logging int...