Jump to content


Photo

[help] How to add a cron entry

dm800se

  • Please log in to reply
14 replies to this topic

#1 frankviana

  • Senior Member
  • 472 posts

+4
Neutral

Posted 4 May 2014 - 15:42

I need to add a cron entry to restart each 5 minutes a bin file (/usr/bin/FILE) and I don't know how.

 

Cron is OK (opkg install busybox-cron).

 

crontab -e

 

??????

 

I have the file running fine, including init.d (rc3.d) with panel start/stop manually, but sometimes need to restart. I need auto restart each 5 minutes.

 

Sorry my english.

 

Thanks

 

Frank

===========================


Edited by frankviana, 4 May 2014 - 15:45.

Dreambox Two, GT-Media V8XS, GT-Media M7x, GT-Media v9 prime, Gt-Media Finder Meter 2, , TBS 6903-x v2, Octagon SF8008 single, Edision OS Mini 4k, Zgemma h9s SE, GT-Media V8UHD, Raspberry Pi 4, T95 Max + (CoreElec/Tvheadend), Freesky Triplo X, Zgemma h9 twin, Zgemma h9s, Amiko SHD 8900, Gt-Media GTC, Octagon SX88+, Octagon SX88, Vu Zero, Vu+ Zero 4K, Mecool K1/K2/K3, Azamerica s2010, Azamerica s810B, Nazabox Xgame, Koqit K1 mini, TBS 5520se, TBS 5925, TBS 6922se, Openbox X5, Openbox S9, AZBOX TITAN twin, AZBOX Premium+, AZBOX Elite , Rasp Pi, Rasp Pi 2/3, Orange Pi PC, Coolsat 5000, Dm528s, DM800se, Satlink 6933, Satlink 6960, Satlink 6932, GT-Media V8, Gt-Media V8 Meter,  PixelView PlayTV USB SBTVD ISDB-T (dib0700), Mygica S270 ISDB-T (Siano Rio). C-Band Motorized dish - 5,00m (20ºE - 116.8ºW), Ku-Band Motorized dish - 1,80m (3ºw - 116,8ºW)


Re: [help] How to add a cron entry #2 Pedro_Newbie

  • Senior Member
  • 4,631 posts

+225
Excellent

Posted 4 May 2014 - 22:15

*/5 * * * * /usr/bin/FILE

Edited by Pedro_Newbie, 4 May 2014 - 22:15.


Re: [help] How to add a cron entry #3 frankviana

  • Senior Member
  • 472 posts

+4
Neutral

Posted 5 May 2014 - 01:55

Thank you. I'll test.


Dreambox Two, GT-Media V8XS, GT-Media M7x, GT-Media v9 prime, Gt-Media Finder Meter 2, , TBS 6903-x v2, Octagon SF8008 single, Edision OS Mini 4k, Zgemma h9s SE, GT-Media V8UHD, Raspberry Pi 4, T95 Max + (CoreElec/Tvheadend), Freesky Triplo X, Zgemma h9 twin, Zgemma h9s, Amiko SHD 8900, Gt-Media GTC, Octagon SX88+, Octagon SX88, Vu Zero, Vu+ Zero 4K, Mecool K1/K2/K3, Azamerica s2010, Azamerica s810B, Nazabox Xgame, Koqit K1 mini, TBS 5520se, TBS 5925, TBS 6922se, Openbox X5, Openbox S9, AZBOX TITAN twin, AZBOX Premium+, AZBOX Elite , Rasp Pi, Rasp Pi 2/3, Orange Pi PC, Coolsat 5000, Dm528s, DM800se, Satlink 6933, Satlink 6960, Satlink 6932, GT-Media V8, Gt-Media V8 Meter,  PixelView PlayTV USB SBTVD ISDB-T (dib0700), Mygica S270 ISDB-T (Siano Rio). C-Band Motorized dish - 5,00m (20ºE - 116.8ºW), Ku-Band Motorized dish - 1,80m (3ºw - 116,8ºW)


Re: [help] How to add a cron entry #4 frankviana

  • Senior Member
  • 472 posts

+4
Neutral

Posted 5 May 2014 - 11:02

Don't work.

 

I need this sequence:

 

cd /usr/bin && killall FILE

 

cd /usr/bin && ./FILE

 

each 5 minutes


Dreambox Two, GT-Media V8XS, GT-Media M7x, GT-Media v9 prime, Gt-Media Finder Meter 2, , TBS 6903-x v2, Octagon SF8008 single, Edision OS Mini 4k, Zgemma h9s SE, GT-Media V8UHD, Raspberry Pi 4, T95 Max + (CoreElec/Tvheadend), Freesky Triplo X, Zgemma h9 twin, Zgemma h9s, Amiko SHD 8900, Gt-Media GTC, Octagon SX88+, Octagon SX88, Vu Zero, Vu+ Zero 4K, Mecool K1/K2/K3, Azamerica s2010, Azamerica s810B, Nazabox Xgame, Koqit K1 mini, TBS 5520se, TBS 5925, TBS 6922se, Openbox X5, Openbox S9, AZBOX TITAN twin, AZBOX Premium+, AZBOX Elite , Rasp Pi, Rasp Pi 2/3, Orange Pi PC, Coolsat 5000, Dm528s, DM800se, Satlink 6933, Satlink 6960, Satlink 6932, GT-Media V8, Gt-Media V8 Meter,  PixelView PlayTV USB SBTVD ISDB-T (dib0700), Mygica S270 ISDB-T (Siano Rio). C-Band Motorized dish - 5,00m (20ºE - 116.8ºW), Ku-Band Motorized dish - 1,80m (3ºw - 116,8ºW)


Re: [help] How to add a cron entry #5 Pedro_Newbie

  • Senior Member
  • 4,631 posts

+225
Excellent

Posted 5 May 2014 - 11:08

But when you insert these commands in a script and run this script every 5 minutes with e.g.:
*/5 * * * * /etc/enigma2/scripts/scriptname.sh


Re: [help] How to add a cron entry #6 frankviana

  • Senior Member
  • 472 posts

+4
Neutral

Posted 5 May 2014 - 11:44

I don't see "scripts" folder (/etc/enigma2)

 

I use this script (init.d)

 

=======================================

#!/bin/sh

CAMNAME="XXXXX"
SYSDATE=`date +%d"-"%m"-"%y"_"%H%M.log`


start(){
    cd /usr/bin && ./FILE >/media/PEN_4GB/software_logfile_$SYSDATE 2>&1
}
stop(){
    killall FILE 2>/media/PEN_4GB/software_logfile_$SYSDATE 2>&1
}

case "$1" in
    start)    
    start
    exit 0
    ;;
    stop)    
    stop
    sleep 1
    exit 0
    ;;
    restart)
    start
    ;;
    *)
    $0 stop
    exit 0
    ;;
esac

exit 0


Dreambox Two, GT-Media V8XS, GT-Media M7x, GT-Media v9 prime, Gt-Media Finder Meter 2, , TBS 6903-x v2, Octagon SF8008 single, Edision OS Mini 4k, Zgemma h9s SE, GT-Media V8UHD, Raspberry Pi 4, T95 Max + (CoreElec/Tvheadend), Freesky Triplo X, Zgemma h9 twin, Zgemma h9s, Amiko SHD 8900, Gt-Media GTC, Octagon SX88+, Octagon SX88, Vu Zero, Vu+ Zero 4K, Mecool K1/K2/K3, Azamerica s2010, Azamerica s810B, Nazabox Xgame, Koqit K1 mini, TBS 5520se, TBS 5925, TBS 6922se, Openbox X5, Openbox S9, AZBOX TITAN twin, AZBOX Premium+, AZBOX Elite , Rasp Pi, Rasp Pi 2/3, Orange Pi PC, Coolsat 5000, Dm528s, DM800se, Satlink 6933, Satlink 6960, Satlink 6932, GT-Media V8, Gt-Media V8 Meter,  PixelView PlayTV USB SBTVD ISDB-T (dib0700), Mygica S270 ISDB-T (Siano Rio). C-Band Motorized dish - 5,00m (20ºE - 116.8ºW), Ku-Band Motorized dish - 1,80m (3ºw - 116,8ºW)


Re: [help] How to add a cron entry #7 Pike_Bishop

  • Senior Member
  • 1,130 posts

+72
Good

Posted 6 June 2014 - 12:42

hi,

 

but you know;

Cron is OK (opkg install busybox-cron).

that's not enough !

to test your cronjob you must start the cron daemon first manually with;

/etc/init.d/busybox-cron start

or much better you put the cron daemon in autostart with;

update-rc.d busybox-cron defaults

and then restart your box complete.

 

 

regards

Biki3


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

Image: OpenPLI-8.3


Re: [help] How to add a cron entry #8 blzr

  • PLi® Core member
  • 2,269 posts

+118
Excellent

Posted 6 June 2014 - 17:20

nope, you don't need to start anything manually nor add any start script or anything after installing busybox-cron from the feed:
 

root@et9x00:~# opkg install  busybox-cron
Installing busybox-cron (1.22.1-r32) to root...
Downloading http://downloads.pli-images.org/feeds/openpli-4/mips32el/busybox-cron_1.22.1-r32_mips32el.ipk.
 Removing any system startup links for busybox-cron ...
Configuring busybox-cron.
 Adding system startup for /etc/init.d/busybox-cron.
starting Busybox Periodic Command Scheduler: crond... done.

Edited by blzr, 6 June 2014 - 17:21.

True sarcasm doesn't need green font...

Re: [help] How to add a cron entry #9 Pike_Bishop

  • Senior Member
  • 1,130 posts

+72
Good

Posted 6 June 2014 - 19:06

hi blzr,

 

maybe...

 

but here i have installed pli-4.0 and first i didn't need that command;

opkg install  busybox-cron

because crond was out of the box in the image

then i maked a cronjob and test it first manually but it didn,t work and with the command top i didn't see a cronjob

only if i make then;

/etc/init.d/busybox-cron

it works

 

as next i restarted my box and it didn't work also, so i take a look at /etc/rc2d, /etc/rc3.d, and so on

and i can't  find any links to /etc/init.d/busybox-cron so i maked;

update-rc.d busybox-cron defaults

and after the next restart all works fine.

 

 

regards

Biki3


Edited by Biki3, 6 June 2014 - 19:06.

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

Image: OpenPLI-8.3


Re: [help] How to add a cron entry #10 blzr

  • PLi® Core member
  • 2,269 posts

+118
Excellent

Posted 6 June 2014 - 20:57

but here i have installed pli-4.0 and first i didn't need that command;
opkg install  busybox-cron
because crond was out of the box in the image

 

well, I'm pretty sure busybox-cron is not installed by default in OpenPLi image...
(btw. how did you deduced that 'crond was out of the box in the image'?)


True sarcasm doesn't need green font...

Re: [help] How to add a cron entry #11 Pike_Bishop

  • Senior Member
  • 1,130 posts

+72
Good

Posted 7 June 2014 - 14:45

hi blzr,

 

i looked into /etc/init.d/ and found there the init script with name busybox-cron

then i looked into it and saw DAEMON=/usr/sbin/crond it was also here under /usr/sbin

but i didn't found the directory /etc/cron/crontabs, only /etc/cron i found, so i maked the missing directory, and into it

also a file with name root with the cronjob in there and then it works with manually start from the busybox-cron

and after a reboot also if i do the following before;

update-rc.d busybox-cron defaults

cross my heart - i'am not aware that i have installed busybox-cron separate.

 

regards

Biki3


Edited by Biki3, 7 June 2014 - 14:49.

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

Image: OpenPLI-8.3


Re: [help] How to add a cron entry #12 Pike_Bishop

  • Senior Member
  • 1,130 posts

+72
Good

Posted 7 June 2014 - 14:52

hi blzr,

 

maybe that's important (but i don't know) i didn't have a dreambox - my box is a xtrend et9000


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

Image: OpenPLI-8.3


Re: [help] How to add a cron entry #13 Pr2

  • PLi® Contributor
  • 6,070 posts

+257
Excellent

Posted 7 June 2014 - 18:37

Hi,

 

No crond is not installed by default on Openpli 4 ET-9000.

 

# opkg list-installed | grep cron
# opkg list | grep cron
busybox-cron - 1.22.1-r32 - Tiny versions of many common UNIX utilities in a single small executable 
enigma2-plugin-extensions-crondmanager - 1.0 - Crondmanager Plugin for dreambox kernel-module-mt9v011 - 3.8.7-r6.11 - mt9v011 kernel module  mt9v011 kernel module; Micron mt9v011 sensor
 
# ls /etc/init.d/busy*
ls: /etc/init.d/busy*: No such file or directory

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: [help] How to add a cron entry #14 GrickoNk

  • Member
  • 1 posts

0
Neutral

Posted 12 September 2014 - 11:27

Hello,I need help witch cron/crontabs/root scrip for reboot ,

30 05 * * * wget -O /dev/null -q http://root:password...tate?newstate=2

35 05 * * * wget -O /dev/null -q http://root:password...tate?newstate=0

dont dreambox go to reboot,same help please.Txn



Re: [help] How to add a cron entry #15 korsan

  • Senior Member
  • 404 posts

+5
Neutral

Posted 18 December 2014 - 10:46

wget -sq http://localhost/web...state?newstate=2

-1: get current state
0: toggle standby
1: poweroff/deepstandby
2: rebootdreambox
3: rebootenigma


H9.Twin  :::  H9.2H :::  H9.S ::: HD1265 ::: H2H :::::::::: WaveFrontier T90: 1W, 3, 7, 13, 16, 19, 23, 28, 42E ::::::::::




Also tagged with one or more of these keywords: dm800se

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users