[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Linux time not redirecting output to log file ...



> And what is with all of the leading underscores and curly brackets?  :-)
~
 Sorry, but I once run into a messy issue while trying to use a shell
command that made me adopt that practice
~
> Please say in words what you are trying to do with stdout and stderr.
> What did you the the above line would do?
~
 Well, again, I want to log AS SEPARATE files and as they happen as
part of the same running process:
~
 a) standard error
~
 b) standard error + standard output combined and as they happen (for
example while using the --verbose option of rsync)
~
> Are you wanting something like this?
~
 ... and that doesn't happen in the code snippet you posted. You are
just doing b) you are not producing standard err as a separate file as
well
~
 Notice that my example:
~
date > $_ERR_OUT
(time rsync --archive --verbose $_SRC $_DEST 2>&1 >&3 | tee $_ERR >&3)
3>> $_ERR_OUT
date >> $_ERR_OUT
~
 produces $_ERR and $_ERR_OUT as separate files, but does not include
the output of time in $_ERR_OUT
~
 Do you have a way to achieve this?
~
 Thank you,
 lbrtchx


On 11/28/13, Scott Ferguson <scott.ferguson.debian.user@gmail.com> wrote:
> On 28/11/13 12:32, Albretch Mueller wrote:
>> ~
>>  I find useful while coding/debugging separating the errors from the
>> output + errors, even if the programming language doesn't allow for
>> that:
>> ~
>>
>> http://coding.derkeiler.com/Archive/Java/comp.lang.java.programmer/2012-08/msg01347.html
>> ~
>>  in this case however I can't get (Linux) time to log into the
>> output+errors log file. It just spits its output on standard err (not
>> the err + out I am trying to redirect it to)
>
>
> "time" yes
> "time -[a]o $file" no
>
>> ~
>>  There must be some syntactic error in my statement. Can you see it?
>> ~
>>  lbrtchx
>>  debian-user@lists.debian.org: Linux time not redirecting output to log
>> file ...
>> ~
>> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
>> ~
>> _SRC="/media/sdb1/cmllpz/ace_verizon"
>> _DEST="/media/sdd1/tmp/test/test1"
>>
>> _PRFX="rsync_"${_DEST##*/}"_"
>>
>> export _DT=$(date +%Y%m%d%H%M%S_%s);
>> _ERR=${_PRFX}${_DT}".err.log"
>> _ERR_OUT=${_PRFX}${_DT}".out_err.log"
>> echo "// __ \${_DT}: |"${_DT}"|";
>> echo "// __ \${_ERR}: |"${_ERR}"|";
>> echo "// __ \${_ERR_OUT}: |"${_ERR_OUT}"|";
>>
>> date > ${_ERR_OUT};
>
>
> What did you the the above line would do? (it has no effect on _ERR_OUT)
>
>
>
> In truth I couldn't work out what you were trying to do (I'm guessing
> "rsync -whateverswitches $source $dest  2>  $log" isn't going to do it
> for you)
>
>
>
> Kind regards
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
> Archive: [🔎] 5296B119.6090901@gmail.com">http://lists.debian.org/[🔎] 5296B119.6090901@gmail.com
>
>


Reply to: