Jump to content


Photo

Crontab info or a Plugin Enigma2


  • Please log in to reply
72 replies to this topic

Re: Crontab info or a Plugin Enigma2 #21 s3n0

  • Senior Member
  • 650 posts

+62
Good

Posted 15 June 2023 - 15:21

 

@marcus83

 

Why don't you read what I write ?

 

Please click on the link (I mean "crontab.guru" webpage), which I sent you before !!! There it is explained in human language, when exactly the specified time-entry will be started, in the CRON configuration line :). This website is designed for exactly this purpose, or primarily for this purpose:

https://crontab.guru/

yes I have already thanked @Tech for this...

 

Well... but I wrote it to you first... just that @Tech didn't notice it and that's why he wrote the same thing as me. I also gave you an explanation + links to the aforementioned crontabs.guru website. Then you wouldn't have to ask the same question every time :-) if you read what I explained to you. Besides everything, the mistake in my opinion is that you don't use the interpreter (/bin/bash </path/shell-script>) to run your shell script, but send the shell script directly to CRON.

 

I don't care. It's help for you. If you don't want help... OK...don't read it ;-). I take it then that you don't need to know :-). But without knowing how the CRON time data works, you will never do it well :-). For me personally, it was a waste of time trying to find out, and for you personally, it was just a burden on people who, instead of writing an "article" for you, could be doing something else.



Re: Crontab info or a Plugin Enigma2 #22 marcus83

  • Senior Member
  • 106 posts

0
Neutral

Posted 15 June 2023 - 16:06

 

 

@marcus83

 

Why don't you read what I write ?

 

Please click on the link (I mean "crontab.guru" webpage), which I sent you before !!! There it is explained in human language, when exactly the specified time-entry will be started, in the CRON configuration line :). This website is designed for exactly this purpose, or primarily for this purpose:

https://crontab.guru/

yes I have already thanked @Tech for this...

 

Well... but I wrote it to you first... just that @Tech didn't notice it and that's why he wrote the same thing as me. I also gave you an explanation + links to the aforementioned crontabs.guru website. Then you wouldn't have to ask the same question every time :-) if you read what I explained to you. Besides everything, the mistake in my opinion is that you don't use the interpreter (/bin/bash </path/shell-script>) to run your shell script, but send the shell script directly to CRON.

 

I don't care. It's help for you. If you don't want help... OK...don't read it ;-). I take it then that you don't need to know :-). But without knowing how the CRON time data works, you will never do it well :-). For me personally, it was a waste of time trying to find out, and for you personally, it was just a burden on people who, instead of writing an "article" for you, could be doing something else.

 

yes but as @Tech explained it to me it was much easier, I'm not an expert like you, try to understand. ;)



Re: Crontab info or a Plugin Enigma2 #23 Pike_Bishop

  • Senior Member
  • 1,140 posts

+74
Good

Posted 15 June 2023 - 19:01

@marcus83,

 

as example if i made a cronjob as follows;

(crontab -l 2>/dev/null; echo "* * * * * sh /usr/script/wz_box_cifswithcron_link.sh") | crontab -

i can remove the same cronjob with command;

crontab -l | grep -v '* * * * * sh /usr/script/wz_box_cifswithcron_link.sh' | crontab - 2>/dev/null;

but with * */1 * * * does the script start every hour?

yes

 

 

regards

Pike


Edited by Pike_Bishop, 15 June 2023 - 19:03.

Receiver: VU Ultimo 4K, Octagon SF8008 4K, Gigablue Quad 4K

Image: OpenPLI-8.3


Re: Crontab info or a Plugin Enigma2 #24 marcus83

  • Senior Member
  • 106 posts

0
Neutral

Posted 15 June 2023 - 19:42

@marcus83,

 

as example if i made a cronjob as follows;

(crontab -l 2>/dev/null; echo "* * * * * sh /usr/script/wz_box_cifswithcron_link.sh") | crontab -

i can remove the same cronjob with command;

crontab -l | grep -v '* * * * * sh /usr/script/wz_box_cifswithcron_link.sh' | crontab - 2>/dev/null;

but with * */1 * * * does the script start every hour?

yes

 

 

regards

Pike

all very clear! thanks man!



Re: Crontab info or a Plugin Enigma2 #25 daviddrf

  • Member
  • 8 posts

0
Neutral

Posted 28 February 2024 - 06:53

Hello all. I've been reading this thread an other threads in the forum in order to achieve my goal without success, sorry.
I have a receiver with Openpli 9.0 and I am trying to schedule a daily timer which resarts the receiver at 08:15 in the morning everyday. Ten (10) minutes later at 08:25 the receiver should go to standby.
My box has cron installed:

root@sh1:~# opkg list-installed | grep cron
busybox-cron - 1.33.2-r0.1
root@sh1:~# grep ARGS= /etc/init.d/busybox-cron
ARGS="-c /var/spool/cron/crontabs"
root@sh1:~#

I tried the following from telnet with commands without success:

mkdir /etc/cron
mkdir /etc/cron/crontabs
(crontab -l 2>/dev/null; echo "15 08 * * * wget -O /dev/null -q http://127.0.0.1/web/powerstate?newstate=6") | crontab -
(crontab -l 2>/dev/null; echo "25 08 * * * wget -O /dev/null -q http://127.0.0.1/web/powerstate?newstate=5") | crontab -

But the problem is the box doesn't restart and doesn't go to standby, it does nothing.

Could you help me please? I think I am making some mistake but I don't know what.

Thank you in advance and sorry for any inconvenient.

 



Re: Crontab info or a Plugin Enigma2 #26 Pr2

  • PLi® Contributor
  • 6,148 posts

+261
Excellent

Posted 28 February 2024 - 09:26

Hi,

 

You have an option in OpenPLi to start the box into standby, so when you reboot it it will go by itself in standby. So there is no need to achieve this by cron.

 

To include entries in cron you should type:

crontab -e

And there place the cron command that you want to use.


NO SUPPORT by PM, it is a forum make your question public so everybody can benefit from the question/answer.
If you think that my answer helps you, you can press the up arrow in bottom right of the answer.

Wanna help with OpenPLi Translation? Please read our Wiki Information for translators

Sat: Hotbird 13.0E, Astra 19.2E, Eutelsat5A 5.0W
VU+ Solo 4K: 2*DVB-S2 + 2*DVB-C/T/T2 (used in DVB-C) & Duo 4K: 2*DVB-S2X + DVB-C (FBC)

AB-Com: PULSe 4K 1*DVB-S2X (+ DVB-C/T/T2)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
 


Re: Crontab info or a Plugin Enigma2 #27 WanWizard

  • PLi® Core member
  • 69,852 posts

+1,781
Excellent

Posted 28 February 2024 - 13:07

You doublecheck what the location of the crontabs are, see it is /var/spool/cron/crontabs, and then you continue by creating them somewhere else?

 

Also, why do you feel the need to restart your box daily? I never restart my boxes, only if they are flashed or I need to boot another image.

root@vuduo4k:~# uptime
 12:10:51 up 54 days, 19:03,  load average: 0.03, 0.01, 0.00

 


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Crontab info or a Plugin Enigma2 #28 daviddrf

  • Member
  • 8 posts

0
Neutral

Posted 28 February 2024 - 15:54

Hi,

 

You have an option in OpenPLi to start the box into standby, so when you reboot it it will go by itself in standby. So there is no need to achieve this by cron.

 

To include entries in cron you should type:

crontab -e

And there place the cron command that you want to use.

Thank you but this is not related to my goal. What I need is restarting the box everyday at 08:15 and going to standby at 08:25. The option you wrote is not what I need. Thank you otherwise.



Re: Crontab info or a Plugin Enigma2 #29 daviddrf

  • Member
  • 8 posts

0
Neutral

Posted 28 February 2024 - 17:11

 

You doublecheck what the location of the crontabs are, see it is /var/spool/cron/crontabs, and then you continue by creating them somewhere else?

 

Also, why do you feel the need to restart your box daily? I never restart my boxes, only if they are flashed or I need to boot another image.

root@vuduo4k:~# uptime
 12:10:51 up 54 days, 19:03,  load average: 0.03, 0.01, 0.00

 

Hello and thank you for your help and support. I need the daily restart and stand by for some "EPG Importer" reasons, but this is not the clue...thanks.
I can confirm that there's a "root" file under "var\spool\cron\crontabs" and its default content is:

30 * * * *    /usr/bin/ntpdate-sync silent

If I apply this:

(crontab -l 2>/dev/null; echo "15 08 * * * wget -O /dev/null -q http://127.0.0.1/web/powerstate?newstate=6") | crontab -
(crontab -l 2>/dev/null; echo "25 08 * * * wget -O /dev/null -q http://127.0.0.1/web/powerstate?newstate=5") | crontab -

Then its content is updated to:

30 * * * *    /usr/bin/ntpdate-sync silent15 08 * * * wget -O /dev/null -q http://127.0.0.1/web/powerstate?newstate=6
25 08 * * * wget -O /dev/null -q http://127.0.0.1/web/powerstate?newstate=5

Maybe I am making a mistake here?

I realize that is not necessary to create "mkdir /etc/cron/crontabs" because the crontabs are not stored there so I deleted that folder.

And I would repeat thank you all for your help and support again.


Edited by daviddrf, 28 February 2024 - 17:13.


Re: Crontab info or a Plugin Enigma2 #30 WanWizard

  • PLi® Core member
  • 69,852 posts

+1,781
Excellent

Posted 28 February 2024 - 18:44

That result is not valid, and if you look at it, it is pretty obvious why.

 

I have a feeling you don't know what you're doing, and why your are doing it, but simply copy-pasting things from elsewhere.

 

Which means you have to explain your problem so people can help you, instead of thinking you already know the solution?


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Crontab info or a Plugin Enigma2 #31 slawek_sp1

  • New Member
  • 4 posts

0
Neutral

Posted 29 February 2024 - 14:30

Hello. openpli 9 . According to crontab.guru websites 5/1 13 * * * “At every minute from 5 through 59 past hour 13.” For me it will run once at 13:05  What is it, what am I doing wrong?



Re: Crontab info or a Plugin Enigma2 #32 WanWizard

  • PLi® Core member
  • 69,852 posts

+1,781
Excellent

Posted 29 February 2024 - 14:53

Have you even looked at what you posted?


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Crontab info or a Plugin Enigma2 #33 slawek_sp1

  • New Member
  • 4 posts

0
Neutral

Posted 29 February 2024 - 15:47

Sorry for my English. It should run at 13:05, 13:06, 13:07, 13:08... but it only runs once at 13:05.

Re: Crontab info or a Plugin Enigma2 #34 WanWizard

  • PLi® Core member
  • 69,852 posts

+1,781
Excellent

Posted 29 February 2024 - 18:19

The problem is that your copy / paste action echo's additional information into the crontab file, without any regard to what is already in the file.

30 * * * *    /usr/bin/ntpdate-sync silent15 08 * * * wget -O /dev/null -q http://127.0.0.1/web/powerstate?newstate=6

You don't see what is wrong with this line ?

Shouldn't that be

30 * * * *    /usr/bin/ntpdate-sync silent
15 08 * * * wget -O /dev/null -q http://127.0.0.1/web/powerstate?newstate=6

???


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Crontab info or a Plugin Enigma2 #35 slawek_sp1

  • New Member
  • 4 posts

0
Neutral

Posted 1 March 2024 - 12:32

Every job added to cron works fine. Please add it if you can and check it out. "45/1 13 * * * /usr/script/test.sh"

Re: Crontab info or a Plugin Enigma2 #36 WanWizard

  • PLi® Core member
  • 69,852 posts

+1,781
Excellent

Posted 1 March 2024 - 13:39

I think I have said all there is to say.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Crontab info or a Plugin Enigma2 #37 slawek_sp1

  • New Member
  • 4 posts

0
Neutral

Posted 1 March 2024 - 19:44

I don't think we understood each other, but it's probably because of my English. Correct entry in cron: "45-59/1 13 * * * /usr/script/test.sh".Thank you for your help.


Edited by slawek_sp1, 1 March 2024 - 19:44.


Re: Crontab info or a Plugin Enigma2 #38 WanWizard

  • PLi® Core member
  • 69,852 posts

+1,781
Excellent

Posted 2 March 2024 - 14:57

It has nothing to do with language.

 

You don't seem to be able to see that you have 2 crontab commands on a single line, and even when I posted the wrong line and the correction, you don't seem to understand it.

 

So I stick with the conclusion you have absolutely no clue what you are doing, and why, you're just trying to implement some hack you found somewhere or someone gave you, without knowing what you are doing.


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Ultimate (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Crontab info or a Plugin Enigma2 #39 s3n0

  • Senior Member
  • 650 posts

+62
Good

Posted 4 March 2024 - 11:30

@slawek_sp1 :

 

Please, describe again what exactly you want to achieve. Exactly on which days, hours, minutes, at what repeated intervals, the shell-script "test.sh" should be run

If you do not know English well, simply use the translator:

https://translate.google.com/

...where in the left window set your native language and in the right window set the English language. After translating the entire text, copy this English text and insert it into the discussion. It is simple.

 

I'm right, if you want to use this ?

https://crontab.guru/#45-49_13_*_*_*

Slash and number 1 - are not needed because it is just the step size. The first number in the crontab config file, represents the minutes of the scheduled time. If you want to enter a step every two minutes, you use "/2", but if you want to use every one minute, you don't need to write "/1" because it's redundant.

 

BTW... if you know, how to use an FTP connection from your PC, to your set-top box, then you can find the configuration file for CRON directly in the set-top box, here: "/etc/cron/crontabs/root". You just need to edit this file manually in a text editor (I recommend the Notepad++), in the comfort of your PC. And then upload the file (save) back to the set-top box. Then you still have to restart the CRON service (I wrote about how to do that in posts earlier!). If you want to do it from Linux-Shell, the procedure (init.d script name) is different for OpenATV and different for OpenPLi.


Edited by s3n0, 4 March 2024 - 11:35.


Re: Crontab info or a Plugin Enigma2 #40 daviddrf

  • Member
  • 8 posts

0
Neutral

Posted 9 March 2024 - 11:51

Hello, finally I was able to achieve my goal. From shell with "crontab -e" command the vi editor is opened. Now I had to press "i" key to switch from command mode to text mode. Then I added this two lines:

15 8 * * * reboot
25 8 * * * wget -O /dev/null -q http://root:@localhost/web/powerstate?newstate=0

Then I pressed the "ESC" key and then wrote ":wq" for exit saving changes. After that if you write "crontab -l" then you can see that the file var\spool\cron\crontabs\root has been properly updated and the crontabs will be executed inmediately without reboot first and they are persistent after rebooting the receiver anytime.

Thank you all for your help and support. Excuse me for my bad English written level and have a nice day.


Edited by daviddrf, 9 March 2024 - 11:52.



22 user(s) are reading this topic

0 members, 21 guests, 0 anonymous users


    Bing (1)