View Full Version : Crond Help Needed
tkenney65
02-19-2005, 10:40 AM
I am running 4.01b on my HDVR2 and am trying to use crond to run "fakecall" once per day. Here's the entry from my root file (/var/spool/cron/crontabs/root). Fakecall is located in /busybox:
0 0 * * * /busybox/fakecall.tcl >> /var/log/fakecalllog 2>&1
I followed AlphaWolf's instructions regarding crond but I am obviously doing something wrong. My Hackman module under TWP indicates that crond is running, but the "fakecalllog" I created for outputting the log file to is empty. Also, the "Settings" and "System Info." sections remain unchanged regarding the "last attempt/last successful" dial out (I am set up to dial out via phone for updates but I have the phone line unplugged).
Here is my rc.sysinit.author file in case that helps:
#!/bin/bash
export TIVO_ROOT=
export MFS_DEVICE=/dev/hda10
# start telnet
tnlited 23 /bin/bash -login &
# start vserver
vserver &
# start ftp
tivoftpd
# make fake daily call (stops nag)
fakecall.tcl
# add two static routes so the TiVo doesn't phone home (stops breakage)
route add -host 204.176.49.2 gw 127.0.0.1
route add -net 204.176.49.0 gw 127.0.0.1 netmask 255.255.255.0
# Call the Tivo Package Manager Startup Scripts
/etc/rc.d/rc.sysinit.tpm
/busybox/crond
Any help is greatly appreciated!!!
Tim
SR712
02-19-2005, 10:54 AM
Are you setting variables such as PATH, SHELL, MFS_DEVICE, and TIVO_ROOT in the crontab file? Like this...PATH=/bin:/sbin:/tvbin:/etc:/tivo-bin
SHELL=/bin/sh
MFS_DEVICE="/dev/hda10"
TIVO_ROOT=""
# mm hh dom mon dow command
# runs fixsub every 5 hours
10 */5 * * * /tivo-bin/fixsub31.tcl
tkenney65
02-19-2005, 11:15 AM
SR712,
No...my "/var/spool/cron/crontabs/root" file only has the following entry:
0 0 * * * /busybox/fakecall.tcl >> /var/log/fakecalllog 2>&1
Sounds like I am missing several variables. Should I enter as you indicated or do I need to modify certain lines for my own setup?
Tim
AhoyMatey
02-19-2005, 12:38 PM
Your path is probably different. The rest is the same. (I actually don't have the SHELL variable in mine.)
SR712
02-19-2005, 01:13 PM
Correct, your path is probably different, but all the others should be the same. Here, read this (http://www.dealdatabase.com/forum/showpost.php?p=127498&postcount=16)
tkenney65
02-19-2005, 03:21 PM
SR712...thanks for that link. I guess, being so new at this, I am a bit lost regarding the PATH statement. Will the one indicated in that link you provided suffice for me? I guess I am unsure what needs to be in it if it must be specific to my setup.
Tim
ja73d
02-20-2005, 03:48 AM
Just replace the /tivo-bin with /busybox in the path that SR712 has and the rest is the same.
SR712
02-20-2005, 01:42 PM
You can find out what your system path is by this at a bash prompt:
echo $PATH
Use the result in the crond file. It might be a good idea to add your /busybox to the end, following the format used.
Don't be too afraid to try things just to see if they will work. What you are doing here is non-destructive, ie. it won't break your TiVo. Cron will either work or not. Give it a shot.
tkenney65
02-20-2005, 04:36 PM
Thanks SR712 and ja73d. I will give it a shot! Your support is appreciated!
tkenney65
02-21-2005, 09:58 PM
OK...so I am doing something wrong. I have followed the advice above and still no sign of "fakecall" being run via crond. No changes listed by the "Settings" or System Info." screens. And my "fakecalllog" is empty. Hackman shows crond is running.
Any thoughts?? Here is my crontab file:
PATH=./:.:/utils:/bin:/sbin:/tvbin:/tivobin:/busybox
SHELL=/bin/sh
MFS_DEVICE="/dev/hda10"
TIVO_ROOT=""
0 0 * * * /busybox/fakecall.tcl >> /var/log/fakecalllog 2>&1
And here's my author file:
#!/bin/bash
export TIVO_ROOT=
export MFS_DEVICE=/dev/hda10
# start telnet
tnlited 23 /bin/bash -login &
# start vserver
vserver &
# start ftp
tivoftpd
# make fake daily call (stops nag)
fakecall.tcl
# add two static routes so the TiVo doesn't phone home (stops breakage)
route add -host 204.176.49.2 gw 127.0.0.1
route add -net 204.176.49.0 gw 127.0.0.1 netmask 255.255.255.0
# Call the Tivo Package Manager Startup Scripts
/etc/rc.d/rc.sysinit.tpm
/busybox/crond
SR712
02-21-2005, 10:49 PM
You could try running cron before the call to TPM. Not sure if there is an issue there or not. Also, to help you troubleshoot, you can place this line in your crontab file:*/10 * * * * date >> /var/hack/etc/cron.test
If cron is running correctly, it will make a file in /var/hack/etc/ called cron.test that will have the time of day when that line executed. It should write a line every 10 minutes if everything is correct. Keeps you from waiting around for hours to see if it is running right. You can change the 10 in there to anything you wish to make it more frequent.
tkenney65
02-21-2005, 11:14 PM
SR712,
Thanks for the help. No sign of a "/var/hack/etc/cron.test" file after adding that line to my crontabs file and updating the author file by moving the call to run crond to before TPM.
Does that log file automatically get created or do I need to create it first? There is no/etc sub-directory in my /var/hack directory
SR712
02-21-2005, 11:45 PM
The file will be created. But I don't think the path will. Either make the directory, or change it to some path that you do have.
tkenney65
02-22-2005, 10:21 PM
ANybodyelse out there who may help? Still no sign on crond running properly at the specified time?
SR712
02-22-2005, 10:37 PM
Are you sure you have cron and crontab files in the exact place that they have to be? There are several different versions of cron out there, and they all need to have cron and crontab in the right place. Some also need passwd and group files in the proper place, too. You need to read the supporting thread for the cron that you have picked, and follow it to the letter. How do you think we can help you? The procedure must work, or it would have been taken down. I'm sure you have made an error or assumption that has prevented this from working. Not a problem. Happens to all of us. You just need to take it step by step, look for places where you could have made an error. You'll find it, I'm sure.
Think about this from our end. It's very hard to troubleshoot a system that you have no access to. And the person that does, just keeps saying, "fix it, fix it".
goony
02-22-2005, 10:37 PM
Deleted by author.
tkenney65
02-22-2005, 10:39 PM
SR712,
I hear you. I'll go back and re-trace my steps. I just figured that since I am so new to things that I made an obvious mistake. Your advice is well received. I appreciate your help thus far.
ds2ktj
02-22-2005, 11:37 PM
Are you sure you created the password file correctly? Without it cron will not work.
If you are using the busy box cron the crontab must be in /var/spool/cron/crontabs/root
You mus have an /etc/passwd file containig at a minimum:
root:x:0:0:root:/:/bin/sh
(have to remount your / partition rw to create this then re-mount it ro.)
For giggles please post the contents of your /etc/passwd (please open it in vi and tell me if there are ^M s at the end of the line - do the same with your crontab) (vi filename ... ESC : q! ENTER)
Blahblah2001
02-23-2005, 09:38 PM
TKenney-
I was having the same problem as you. I vi'ed my root file as instructed and added the variables and saved. It didn't start working until i kill the crond process and restarted it, however. Give that a try if you haven't.
tkenney65
02-23-2005, 10:45 PM
SR712 (and others),
With your guidance I re-traced all of my steps and it turns out that I made an error when creating my user definitions for crond (I had O where there should have been 0....UGGH!). As a result my crontab was being ignored.
Thanks again for all of the support and guidance. All is working well now!!
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.