1

I'm using Linux Mint 13, MATE edition.

I've just run a lot of very slow rsync processes which created a huge amount of output to STDOUT. The last one also outputted a message (presumably to STDERR, but I'm not sure) saying that some files couldn't be copied.

I'm now worried that some of the earlier commands may have outputted an error message too, and I didn't notice. Is there a way to retrospectively view the history of STDERR? I know that if i'd thought of it in advance I could have run the commands in such a way as to save STDERR to a text file, but this is something I need to do after the fact.

I still have the terminal window open. I've tried scrolling up but my scroll buffer is full of all the STDOUT output.

thanks, Max

  • 2
    The messages you can't scroll back to are gone. You could check the logs on the server though. Or you could run the rsync command again. Unless you did something destructive such as --delete-before or similar, it should work (and fix any problems). – Satō Katsura Jul 19 '16 at 9:59
  • @SatoKatsura that (re-running rsync) is what I've done, ultimately. It was copying off lots of DVDs so it was a bit of a pita to swap them all in and out. But, as you say, the rsyncs themselves were very quick. I'm still interested in seeing the history for future reference though: can you expand on which log files I should look in? In case it's relevant there's no external hosts involved (if that's what you meant by 'server') - it's copying from my dvd drive to a usb hard drive. – Max Williams Jul 19 '16 at 10:01
  • If you're rsync-ing with another machine then there's a server and a client. Both sides can log to syslog, but IIRC the server does so by default. The client needs to be told explicitly to do that. I don't think that's true if you're just rsync-ing directories locally though. – Satō Katsura Jul 19 '16 at 10:04
  • @SatoKatsura so if it's all just local then you think there's no log at all? – Max Williams Jul 19 '16 at 10:39
  • 1
    @MaxWilliams There is an option --log-file, but obviously this only applies to future runs. Like I said, with a remote server you'd have logging enabled by default on the other end. – Satō Katsura Jul 19 '16 at 13:33
0

Unless you took steps to log the output somewhere beforehand (e.g. by logging the whole session with [script](https://en.wikipedia.org/wiki/Script_(Unix)), or by redirecting the output to a file), the output of the command that's scrolled off the screen is gone¹.

In the case of rsync, this isn't a problem. Rsync is usually idempotent (this is not always true, but with most option combinations it's idempotent), so just run it again to see errors again.

¹ Some of it may still be present in memory somewhere, but dumping the memory and then combing the dump for it is a long and difficult task and has a high risk of not finding anything because that bit of memory has already been reused.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.