public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Rance Hall <ranceh@gmail.com>
To: cygwin@cygwin.com
Subject: Re: 1.7.7: window cuts off output / saving output
Date: Wed, 02 Feb 2011 16:46:00 -0000	[thread overview]
Message-ID: <AANLkTiksXEW-=G8D+4Vie1Z6paxLgLQY8mnDYxNZrZpB@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimr-ofHogw+VRXw+fM58wgfyAB1M31HJh1u-PjQ@mail.gmail.com>

On Wed, Feb 2, 2011 at 10:13 AM, Rachel Trent <retrent@ncsu.edu> wrote:
<snip>
>
> Long version:
> Within a larger script, I copied over a thousand files from one server
> to another using the following command:
> cp -R -n -p -v "$package" "$destination" | tee -a "$destination"/copiedfiles.txt
>
> However, several files failed to copy due to permissions issues/etc,
> and the copiedfiles.txt file does not include the error information.
> The onscreen output does include this information (due to using the -v
> verbose option), however I can only scroll up to see about 300 lines
> of information (surprise! I wasn't expecting this). My question is:
> can I somehow access the output that was cut off?
>

I don't happen to think that "tee" is the right tool here.

The standard way to do this and record the error messages is with redirection.

In standard linux the screen output is from the stdout device and the
error message is printed to the stderr device with a standard screen
setup both stdout and stderr are the screen, but when you are
recording data to a log file for historical needs, you have to
redirect stderr to stdout so that the tee command can actually see it.

add a 2>&1 to the cp command at the end before the pipe, and tee will
get the errors as well.

BTW this is generically true for all POSIX compatible screen based tools.

Rance

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

      parent reply	other threads:[~2011-02-02 16:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTik3fYVoeP97HrDwP8h3-jBbAr4qmco7EasOTECg@mail.gmail.com>
2011-02-02 16:29 ` Rachel Trent
2011-02-02 16:37   ` Corinna Vinschen
2011-02-02 16:44   ` Jeremy Bopp
2011-02-02 16:49     ` Jeremy Bopp
2011-02-02 16:46   ` Rance Hall [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTiksXEW-=G8D+4Vie1Z6paxLgLQY8mnDYxNZrZpB@mail.gmail.com' \
    --to=ranceh@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).