Unix administration - [Q] TEE does NOT put screen messages to log file???

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > December 2004 > [Q] TEE does NOT put screen messages to log file???





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [Q] TEE does NOT put screen messages to log file???
aaa

2004-12-27, 5:52 pm

We are doing batch script for backup. The server is IBM RS/6000 AIX 4.3.3
version. The script supportly should show backup messages on monitor screen and
also on log file. I test the script and look like "tee" does NOT put screen
messages to file.

my backup script are:

for i in `cat /home/backup/lvdir`
do
/usr/sbin/backup -0 -u -f /dev/rmt1.1 $i |tee -a /tmp/backup.log
echo "* \n" >>/tmp/backup.log
echo "* End of backup file system: $i \n" >>/tmp/backup.log
echo "********************************** \n" >>/tmp/backup.log
echo "* \n" >>/tmp/backup.log
done

Any ideal?

Thanks.

Chris F.A. Johnson

2004-12-27, 5:52 pm

On Mon, 27 Dec 2004 at 21:07 GMT, aaa wrote:
> We are doing batch script for backup. The server is IBM RS/6000 AIX 4.3.3


Please do not multi-post. Your question has been answered in
comp.unix.shell.

If you feel you must post a question in more than one group,
cross-post (i.e., put all the newsgroups in a comma-separated list
on the Newsgroups: line in the header.


--
Chris F.A. Johnson http://cfaj.freeshell.org/shell
========================================
===========================
My code (if any) in this post is copyright 2004, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
Barry Margolin

2004-12-27, 5:52 pm

In article <cqptj001dsa@drn.newsguy.com>, aaa <mccdba@yahoo.com> wrote:

> We are doing batch script for backup. The server is IBM RS/6000 AIX 4.3.3
> version. The script supportly should show backup messages on monitor screen
> and
> also on log file. I test the script and look like "tee" does NOT put screen
> messages to file.
>
> my backup script are:
>
> for i in `cat /home/backup/lvdir`
> do
> /usr/sbin/backup -0 -u -f /dev/rmt1.1 $i |tee -a /tmp/backup.log
> echo "* \n" >>/tmp/backup.log
> echo "* End of backup file system: $i \n" >>/tmp/backup.log
> echo "********************************** \n" >>/tmp/backup.log
> echo "* \n" >>/tmp/backup.log
> done
>
> Any ideal?


Two possibilities:

1) The messages you're not seeing in the file were written to stderr,
but you're only piping stdout. Try changing it to:

/usr/sbin/backup -0 -u -f /dev/rmt1.1 $i 2>&1 |tee -a /tmp/backup.log

2) Backup is writing messages directly to /dev/tty, not stdout. Expect
may come with a script that will capture this for you.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com