On Tue, Jul 22, 2003 at 06:41:54PM -0400, System Administrator wrote:
> I am assumong that you use something on the order of
> 
> dumpcommandline  > /var/log/backup
> If so - change to dumpcommandline  >> /var/log/backup
> 
> the >> appends rather than writing to the file.
> 
> On Tuesday 22 July 2003 18:17, AragonX wrote:
> > I'm running a nightly backup using dump.  I'm outputting the information
> > to a log file /var/log/backup.  I would like to add to the file each time
> > I run a backup.  How do I do that?  Do I use cat?

No, don't use cat.  It will work part of the time, but if two
processes try to log something at the same time things will get
garbled or lost or I'm-not-sure.  Use logger (for shell access) or
syslog(3) (for C access).

For example, I just did this:

  # logger this was written with logger and my term is $TERM

And in /var/log/message I see:

  Jul 23 09:49:59 localhost logger: this was written with logger and my term is dumb

You can also pipe things into logger, such as this:

  # date | logger

To get this in /var/log/messages:

  Jul 23 09:53:24 localhost logger: Wed Jul 23 09:53:24 EDT 2003


There are various switches to logger to modify its behavior, including
what file to log to, etc.


-kb, the Kent who didn't know about logger until now, but he knew
simple redirection was a bad idea and started looking through a couple
man pages.


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list

Reply via email to