Re: Something Odd - "top" Delivers Nada When Run By Crontab
The Natural Philosopher <[email protected]>
| Newsgroups | comp.os.linux.misc |
|---|---|
| Organization | A little, after lunch |
| Message-ID | <[email protected]> |
On 13/07/2026 00:25, c186282 wrote: > On 7/11/26 23:36, Rich wrote: >> c186282 <[email protected]> wrote: >>> On 7/11/26 02:40, rbowman wrote: >>>> On Fri, 10 Jul 2026 23:57:54 -0400, c186282 wrote: >>>> >>>>> Wrote a short Python script that uses os.system() to run 'top' ... >>>>> redirecting the output to a file. We then clean-up the weird chars in >>>>> the file and append it to an ongoing log file. >>>> >>>> I think we've been here before... >>>> >>>> https://docs.python.org/3/library/subprocess.html >>>> >>>> Yes, it's one of those hateful, newfangled functions that might work >>>> for >>>> you. >>> >>> Um ... there are LOTS of 'monitoring' apps for Linux >>> at this point - just did a survey a couple of days >>> ago. Most are serious OVER-kill. They also tend to >>> record SO much shit that you'll never be able to find >>> YOUR particular problem in the mess. >>> >>> Anyway, the "-b" param to 'top' did do the trick. >>> Still not sure why evoking from the CL is so different >>> from evoking via crontab - but that's how it is. >> >> Because without -b, top expects to be connected to a tty. And when >> running from a crontab, there is no tty. With no tty, top didn't >> bother doing anything but exiting. >> >> This is basic Unix 101 level stuff. > > Some were late to class that day :-) > > More relevantly, - no one knows all of Unix/Linux - some peoples experience goes very deep is some areas - conversely those areas having been been completely irrelevant and never explored is someone else's life experience. For example, I never had any need whatsoever to type 'emacs' on a command line Other peoples days (if their session was not still active) did that as the first thing in the morning. It being some primitive approximation to a multi tasking windows session. > > -- "First, find out who are the people you can not criticise. They are your oppressors." - George Orwell