Re: [Q] TEE does NOT put screen messages to log file???

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 12/27/04


Date: Mon, 27 Dec 2004 17:01:10 -0500

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 ***


Relevant Pages

  • Feedback on backup script
    ... The one problem I have is that the script keeps stopping at lines 633,635 and or 637 with the error "Path Not Found" I have emailed the original author for help but haven't heard back yet. ... I was just wondering if the problem could be that the account running the script doesn't have correct permissions to a share/directory/file that it's trying to backup? ... ' always one less than the actual number of folders. ... ' Show the user free space info on all available disk drives ...
    (microsoft.public.scripting.vbscript)
  • Re: Enterprise Manager Newbie Question
    ... a SQL backup is not a simple copy of the database files. ... Is it possible to write a script that one could run from a workstation and ...
    (microsoft.public.sqlserver.tools)
  • Re: xcopy and vbscript
    ... It takes about 5-6 minutes to backup approximately ... A copy of the script is below for reference. ... ObjShell.Popup strMessage, 5, "Backup Complete", OK_Button ... Dim sSrc, sDest ' as string ...
    (microsoft.public.scripting.vbscript)
  • Re: batch file to delete files based on criteria
    ... >> I need to throw together a simple batch file to backup a file. ... >> schedule this via Task Scheduler to run every hour or so. ... > Create a snapshot backup when a file changes. ... >!Snapshot script from inside Windows Explorer. ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: How do I move an account... A few more details... and more
    ... >> use this system as a backup system if the first ever goes down. ... >> rsync for this. ... >serv1 and the system you back up to is fs. ... >rsync script. ...
    (Fedora)