View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 50 posts ] 
Go to page Previous  1, 2, 3, 4  Next

Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: Re: crontab sanity check
PostPosted: Sun Jan 28, 2007 4:14 pm 
Offline
Joined: Fri Nov 18, 2005 9:22 am
Posts: 777
Location: spencerport, ny (USA)
neutron68 wrote:
By the way, the suggested crontab commands don't work in R5E50.


Sure they do! But if you don't have a crontab, it'll be blank.
In that case, just issue:
Code:
vi crontab.txt


from "man crontab"
Code:
 The  -l  option  causes the current crontab to be displayed on standard output..


Try it - and you should see that things run, the way I said.


Top
 Profile  
 
 Post subject: Re: crontab sanity check
PostPosted: Sun Jan 28, 2007 4:26 pm 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
thornsoft wrote:
neutron68 wrote:
By the way, the suggested crontab commands don't work in R5E50.


Sure they do! But if you don't have a crontab, it'll be blank.

I've got a crontab file! I've got /etc/crontab and it's got text in it.
Why doesn't that text show up with the crontab -l and -e commands?

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 28, 2007 10:18 pm 
Offline
Joined: Thu Nov 25, 2004 11:15 pm
Posts: 75
How is this script different from mbemon ( http://mysettopbox.tv/phpBB2/viewtopic.php?t=10998 )? Based on the descriptions, mbemon seems more robust and includes pretty good logging. mbemon seems to run alright on R5E50 or am I missing something? I'm just confused about the difference.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 28, 2007 11:18 pm 
Offline
Joined: Fri Nov 18, 2005 9:22 am
Posts: 777
Location: spencerport, ny (USA)
I didn't know about mbemon, it certainly seems quite comprehensive. With all the backend problems since R5E50, I'm surprised nobody mentioned it before now.


Top
 Profile  
 
 Post subject: Re: crontab sanity check
PostPosted: Sun Jan 28, 2007 11:25 pm 
Offline
Joined: Fri Nov 18, 2005 9:22 am
Posts: 777
Location: spencerport, ny (USA)
neutron68 wrote:
I've got a crontab file! I've got /etc/crontab and it's got text in it.
Why doesn't that text show up with the crontab -l and -e commands?


crontab -l is going to show you the crontab entries for the current userid.
i.e. "root".

/etc/crontab is the "system crontab". I've never dealt with that directly.


Top
 Profile  
 
 Post subject: Re: crontab sanity check
PostPosted: Mon Jan 29, 2007 9:04 am 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
thornsoft wrote:
neutron68 wrote:
I've got a crontab file! I've got /etc/crontab and it's got text in it.
Why doesn't that text show up with the crontab -l and -e commands?


crontab -l is going to show you the crontab entries for the current userid.
i.e. "root".

/etc/crontab is the "system crontab". I've never dealt with that directly.


Oh, man! So, there are multiple crontabs to keep track of??? :shock:
I'm slowly seeing the big picture take shape - one bit of information at a time. Up to now, I've been putting every cron job into the /etc/crontab file.

In my mind, this babysitting script is a good thing for the system crontab to do, since it is necessary for the system to stay functional.

Thanks for the clarifications.

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 
 Post subject: Re: crontab sanity check
PostPosted: Mon Jan 29, 2007 6:54 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
thornsoft wrote:
/etc/crontab is the "system crontab". I've never dealt with that directly.

Yes, multiple crontabs. A system one and a private one for every user. One difference to be aware of is that the system one require a username in column six, and the command in column 7 and beyond, but the user ones do not allow that and the command starts in column 6.

Code:
root@black2:~# crontab -l
*/5 * * * * /usr/local/bin/rrd_all.sh
root@black2:~# more /etc/crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
root@black2:~# crontab -l
*/5 * * * * /usr/local/bin/rrd_all.sh

I've seen at least a couple people get confused and bitten by this in the last several weeks.


Top
 Profile  
 
 Post subject: Re: crontab sanity check
PostPosted: Mon Jan 29, 2007 8:02 pm 
Offline
Joined: Fri Nov 18, 2005 9:22 am
Posts: 777
Location: spencerport, ny (USA)
tjc wrote:
I've seen at least a couple people get confused and bitten by this in the last several weeks.

Thanks tjc,
Do you know where this thing came from? Has it been in Linux from the beginning? I used to do lots of Unix work (AIX), and never encountered this thing. Maybe it was there and I never knew it! No matter how much you think you know, there's always something.
Are there general guidelines as to when you use one vs. the other?
Along that line, should something like this job (or my babysit_commflag.sh) be run as mythtv instead of root?


Top
 Profile  
 
 Post subject: Re: crontab sanity check
PostPosted: Mon Jan 29, 2007 8:21 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
thornsoft wrote:
Do you know where this thing came from? Has it been in Linux from the beginning?

I think it's been around for a long time. Maybe a Vixie cron thing? AIX is a really odd mix. It's the only Unix family OS I'm aware of where admins still regularly add stuff to /etc/inittab rather than putting a script in /etc/init.d and symlinks in the /etc/rc*.d directories.
thornsoft wrote:
Are there general guidelines as to when you use one vs. the other?

About what you'd expect. You only want really fundamental mechanism in /etc/crontab, it's there to drive other ones.
thornsoft wrote:
Along that line, should something like this job (or my babysit_commflag.sh) be run as mythtv instead of root?

Sounds like a good idea to me.


Top
 Profile  
 
 Post subject: followed your advice
PostPosted: Tue Jan 30, 2007 4:36 pm 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
OK, I followed your advice. I removed the script call from the /etc/crontab and put it in the root crontab as shown on page 1 of this thread (I used nano rather than vi to do my text edits, however).

Now I am Linux-compliant, right? :)

Eric

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 
 Post subject: Re: followed your advice
PostPosted: Tue Jan 30, 2007 6:55 pm 
Offline
Joined: Fri Nov 18, 2005 9:22 am
Posts: 777
Location: spencerport, ny (USA)
neutron68 wrote:
Now I am Linux-compliant, right? :)
Eric

Hey, I wasn't complaining about your other method. I was just unfamiliar with it. But I knew that my approach WOULD work.
Anyway, I'm glad you're operational now.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 02, 2007 6:40 am 
Offline
Joined: Wed Jan 25, 2006 1:03 pm
Posts: 240
Location: Shakopee, MN USA
Thronsoft -

Thank you for posting both your "babysitting" scripts. The mythbackend went down on me yesterday during heavy recording (Utilizing both tuners of my PVR-500). This was before I installed the script. I installed both of them in the regular crontab (not system) and they are both working great. I was not having any issues with the commflag hitting on performance (I think since my Opteron is dual core) but I though it would be helpful when I start playing back HD content.


Top
 Profile  
 
 Post subject: if empty?
PostPosted: Fri Feb 02, 2007 9:22 am 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
Since activating the babysitter script, I have watched the file /var/log/mythtv/babysit_backend.log and it remains empty.
Does that mean that my backend has not needed restarting? I got the impression that the backend was comming disconnected for everyone with R5E50 and this log would slowly fill up with entries?

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 
 Post subject: Re: if empty?
PostPosted: Fri Feb 02, 2007 10:27 am 
Offline
Joined: Fri Nov 18, 2005 9:22 am
Posts: 777
Location: spencerport, ny (USA)
neutron68 wrote:
Since activating the babysitter script, I have watched the file /var/log/mythtv/babysit_backend.log and it remains empty.
Does that mean that my backend has not needed restarting? I got the impression that the backend was comming disconnected for everyone with R5E50 and this log would slowly fill up with entries?

Test it by killing the backend with Alt+2 and it should re-start within a minute.


Top
 Profile  
 
 Post subject: it's working
PostPosted: Fri Feb 02, 2007 11:30 am 
Offline
Joined: Tue Mar 28, 2006 8:26 pm
Posts: 804
Location: Minneapolis, MN
thornsoft wrote:
Test it by killing the backend with Alt+2 and it should re-start within a minute.

I just killed the backend and it restarted within 1 minute. The log file now has an entry
Code:
Fri Feb  2 11:21:01 CST 2007 - Myth Backend Babysitter - restart needed
Restarting MythTV server: mythbackendNo /usr/bin/mythbackend found running; non$
.
.
Sleeping....
Myth Backend restarted as process 5116.

I can see that it is working. Now, I'm surprised that the backend hasn't been disconnecting on me, like it has with others.

_________________
KnoppMyth R5.5, Asus A8N-VM CSM (nvidia 6150 onboard video), AMD Athlon 64 dual-core 4200+, two 1GB sticks DDR 400, HD-3000 HDTV card, PVR-150 card, Iguanaworks RS-232 IR receiver/transmitter, Pioneer DVR-110 DVD burner


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 50 posts ] 
Go to page Previous  1, 2, 3, 4  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu