PDA

View Full Version : vix 1.3 crons manager help plz



cozmo
24-12-10, 23:19
can someone please tell me the line i would need to enter into cron manger on vix 1.3 to make my box do a full reboot at a set time each day plz i know people are gonna say why do u want to do that and the answer is that i feel it keeps the box nice and fresh imo to reboot everyday

any help would be great

thanks cozmo

cozmo
27-12-10, 12:34
ok if no one can help me with this can some at least tell me if i can do this from the cron manager in vix 1.3 or if i need to edit the crons file to do it

any help you be great

thanks
Cozmo

cozmo
29-12-10, 11:58
this crons job manager is a nightmare i have tried script with it i have tried /sbin/reboot/ , reboot/ and nothing guess its a very gray area with no one at all knowing the answer after 90 people have viewed the thread

thanks anyways have always managed to get good help before in this forum

thanks again

Cozmo

i have just tried /sbin/shutdown -r now but still no go am i right in guessing that the cron deamon is running all the time eg that i only have to enter the command and time in vix 1.3 cron manager and then see if it triggers at the time set ????

silverfox0786
29-12-10, 19:32
pooface may be the best to help you but he is away in france at the moment when he is back in new year i'm sure he will be able to help you out

art
01-01-11, 15:29
this crons job manager is a nightmare i have tried script with it i have tried /sbin/reboot/ , reboot/ and nothing guess its a very gray area with no one at all knowing the answer after 90 people have viewed the thread

thanks anyways have always managed to get good help before in this forum

thanks again

Cozmo

i have just tried /sbin/shutdown -r now but still no go am i right in guessing that the cron deamon is running all the time eg that i only have to enter the command and time in vix 1.3 cron manager and then see if it triggers at the time set ????

Hi Cozmo,

I noted that the cronabs on vix 1.3 were in /etc/cron/crontabs but on issuing "crontab -l" it tried to chdir to /crontabs and of course this caused an error. So I rectified this by creating a symlink off root with "ln -s /etc/cron/crontabs /crontabs". On the next issue of "crontab -l" it now worked fine and showed no current entries for user root so I ussued "crontab -e" and added the following on the first line:

30 03 * * * /sbin/reboot

This should cause the box to reboot at 03:30 every morning but What we probably need then is to put the box in standby mode. There's probably an enigma2 command, plugin or setting that can be used as part of a very simple script to have cron execute the reboot and place the box back in standby mode if you dont wish the box to be up and running during the early hours of the morning. Sorry mate I'm no expert on the enigma side of things but the method above will certainly do the reboot for you!

Happy New Year!

cozmo
01-01-11, 20:22
Hi Cozmo,

I noted that the cronabs on vix 1.3 were in /etc/cron/crontabs but on issuing "crontab -l" it tried to chdir to /crontabs and of course this caused an error. So I rectified this by creating a symlink off root with "ln -s /etc/cron/crontabs /crontabs". On the next issue of "crontab -l" it now worked fine and showed no current entries for user root so I ussued "crontab -e" and added the following on the first line:

30 03 * * * /sbin/reboot

This should cause the box to reboot at 03:30 every morning but What we probably need then is to put the box in standby mode. There's probably an enigma2 command, plugin or setting that can be used as part of a very simple script to have cron execute the reboot and place the box back in standby mode if you dont wish the box to be up and running during the early hours of the morning. Sorry mate I'm no expert on the enigma side of things but the method above will certainly do the reboot for you!

Happy New Year!

i have done the above and now in telnet the crontab -l shows my cron job but the box will still not reboot at the set time im at a loss :(

Cozmo

silverfox0786
01-01-11, 22:00
have you trie killall -9 enigma2

and set the time as you want it

rob76
02-01-11, 10:01
Did the command work as expected outside cron (just from shell)?

art
02-01-11, 15:01
i have done the above and now in telnet the crontab -l shows my cron job but the box will still not reboot at the set time im at a loss :(

Cozmo

certainly worked for me cozmo mate as my box was left in standby when I went to bed and was sitting on BBC One HD this morning, although my system history suggested the reboot took place at 00:00 but I guess that has something to do with the system having to wait for a time sync from the satellite and my wtmp file being initialised before the time sync. Make sure crond is running by looking in "top" for this string:

/usr/sbin/crond -c /etc/cron/crontabs -L /tmp/cron.log

or from the command line in telnet issue:

ps -ef|grep crond|grep -v grep

You should see a crond process returned like this:

root@bm750:~# ps -ef|grep crond|grep -v grep
647 root 2760 S /usr/sbin/crond -c /etc/cron/crontabs -L /tmp/cron.log

Now check your system time with "date". If all is ok there then try rebooting the box manually with /sbin/reboot as rob76 suggests

BTW in the VIX menu cron manager I also see the cronjob listed. At system level that should supercede anything that enigma2 is doing. If it doesn't work following the above I would first of all set the date manually using the date command and set the reboot job to take place a few minutes later. Keep having a play and let us know how you go on

cozmo
02-01-11, 16:56
works now thank you all just what i wanted very very happy now and thank u art for your pm i was not entering via the crontab -e as i didnt know the commands to take it out of read only so i entered it in cron manager on vix 1.3 witch did not work but when i followed what you said and entered it via crontab -e worked first time

thanks so much

cozmo

ps here is a copy of arts pm and how i got it working for anyone else

""I used crontab -e from the telnet command line to enter the reboot command. That will open roots crontab file in read only mode. whilst in that mode and on the line with the reboot entry type "dd" and that will remove the entry or pressing "x" at the beginning of the line will delete one character at a time. Make sure the file is empty of all text and any apparent spaces. Now type "i" and that will put you into insert mode. Type the following:

30 03 * * * /sbin/reboot

as soon as you have enterered the last character on the line [t] press the esc key and that will put you back in read only mode. Now type:

:wq!

and this will exit out of crontab -e and save the file. Now check this with crontab -l at the command line and it should return what you typed in crontab -e
i.e your cronjob will be listed. This is the system level job scheduler and will override anything that the enigma2 engine is performing at the time. Hence you wouldn't really want to do this if you knew the enigma2 internal job manager was performing some sort of action you had predefined from the VIX menu. Ideally if I knew a bit more about the internal workings of enigma2 I would have the reboot sequence start from there so that it had the chance to clean up and check running jobs before finally running the reboot....just like if you try to shutdown the box and a recording is in place you will get a warning message on screen.""

art
03-01-11, 11:41
Oh BTW Cozmo m8 although I don't know the enigma2 routine to put the box into standby you can of course use the VIX AutoStandby menu item to put the box back into standby at say something like 03:40am. I set this on mine last night and hey presto it was sitting in standby this morning. Not as elegant as having a script to reboot and set standby via the Enigma2 engine in one go but does the job you require. I think AndyBlac or Pooface could probably help us with this. Personally I'd have the enigma2 engine have an open ended unix pipe and just feed it the routine via a cron job. I'll have a scout round on the net and see what can be done or just wait for our resident experts to come up with a neater solution :)