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
  • 322 posts

+2
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.

Octagon SX88+, Octagon SX88, Vu Zero (mips) Vu+ Zero 4K (arm), Mecool K1/K2/K3, Azamerica s2010, Nazabox Xgame, TBS 5520se, TBS 5925, TBS 6922se, Openbox X5, Openbox S9, AZBOX TITAN twin, AZBOX Premium+, AZBOX Elite , Raspberry 2/3, Orange pi PC, Coolsat 5000, Dm500s. Motorized dish - 5m (20ºE - 116.8ºW). A lot of plugins...


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

  • Senior Member
  • 4,627 posts

+224
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
  • 322 posts

+2
Neutral

Posted 5 May 2014 - 01:55

Thank you. I'll test.


Octagon SX88+, Octagon SX88, Vu Zero (mips) Vu+ Zero 4K (arm), Mecool K1/K2/K3, Azamerica s2010, Nazabox Xgame, TBS 5520se, TBS 5925, TBS 6922se, Openbox X5, Openbox S9, AZBOX TITAN twin, AZBOX Premium+, AZBOX Elite , Raspberry 2/3, Orange pi PC, Coolsat 5000, Dm500s. Motorized dish - 5m (20ºE - 116.8ºW). A lot of plugins...


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

  • Senior Member
  • 322 posts

+2
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


Octagon SX88+, Octagon SX88, Vu Zero (mips) Vu+ Zero 4K (arm), Mecool K1/K2/K3, Azamerica s2010, Nazabox Xgame, TBS 5520se, TBS 5925, TBS 6922se, Openbox X5, Openbox S9, AZBOX TITAN twin, AZBOX Premium+, AZBOX Elite , Raspberry 2/3, Orange pi PC, Coolsat 5000, Dm500s. Motorized dish - 5m (20ºE - 116.8ºW). A lot of plugins...


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

  • Senior Member
  • 4,627 posts

+224
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
  • 322 posts

+2
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


Octagon SX88+, Octagon SX88, Vu Zero (mips) Vu+ Zero 4K (arm), Mecool K1/K2/K3, Azamerica s2010, Nazabox Xgame, TBS 5520se, TBS 5925, TBS 6922se, Openbox X5, Openbox S9, AZBOX TITAN twin, AZBOX Premium+, AZBOX Elite , Raspberry 2/3, Orange pi PC, Coolsat 5000, Dm500s. Motorized dish - 5m (20ºE - 116.8ºW). A lot of plugins...


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

  • Senior Member
  • 659 posts

+23
Neutral

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: Mutant HD 2400, VU Ultimo 4k

Image: PLI 6.0


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

  • PLi® Core member
  • 2,005 posts

+99
Good

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 Biki3

  • Senior Member
  • 659 posts

+23
Neutral

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: Mutant HD 2400, VU Ultimo 4k

Image: PLI 6.0


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

  • PLi® Core member
  • 2,005 posts

+99
Good

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 Biki3

  • Senior Member
  • 659 posts

+23
Neutral

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: Mutant HD 2400, VU Ultimo 4k

Image: PLI 6.0


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

  • Senior Member
  • 659 posts

+23
Neutral

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: Mutant HD 2400, VU Ultimo 4k

Image: PLI 6.0


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

  • PLi® Contributor
  • 3,253 posts

+142
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)
Edision OS Mio 4K: 1*DVB-S2X + 1*DVB-C/T/T2
Octagon SF4008 / Amiko Viper Combo / Zgemma H7C

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
  • 389 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


HD1265 ::: XP1000 ::: ET7000 ::: ET9500 :::::::::: WaveFrontier T90: 1, 5, 7, 13, 16, 19, 23, 28, 42 :::::::::: Qnap TS-112 NAS






Also tagged with one or more of these keywords: dm800se

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users