Ga naar inhoud


[AZBOX HD] Crond - Wie heeft em werkend?


rtificial

Aanbevolen berichten

Ik heb afgelopen weekend de Crond plugin geinstalleerd, en hoopte hiermee een dagelijke restart van m'n plugins the kunnen realiseren, maar vooralsnog is nog niets gelukt, welk schedule ik ook aanmaak in de crontab.

 

Heeft er iemand meer succes mee?

DB800HD ~ AZBox HD Premium ~ Archsat 3/1 ~ Apple TV2 XBMC

Link naar reactie
Delen op andere sites


Origineel bericht van: Aart J. Wessels
ik denk dat er fout zat in m'n script ofzo.

met 15 * * * * heeft ie zojuist wel wat uitgevoerd.

Ik kijk nog even verder. Toch alvast bedankt!


Een duidelijke uitleg van de crontab config van de redhat site, wat geknipt voor uw gemak :-)

Origineel bericht van: "Redhat"

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

Each line in the /etc/crontab file has the format:

minute hour day month dayofweek command

minute — any integer from 0 to 59
hour — any integer from 0 to 23
day — any integer from 1 to 31 (must be a valid day if a month is specified)
month — any integer from 1 to 12 (or the short name of the month such as jan, feb, and so on)
dayofweek — any integer from 0 to 7 where 0 or 7 represents Sunday (or the short name of the week such as sun, mon, and so on)

command — the command to execute. The command can either be a command such as ls /proc >> /tmp/proc or the command to execute a custom script that you wrote.

For any of the above values, an asterisk (*) can be used to specify all valid values. For example, an asterisk for the month value means execute the command every month within the constraints of the other values.

A hyphen (-) between integers specifies a range of integers. For example, 1-4 means the integers 1, 2, 3, and 4.

A list of values separated by commas (,) specifies a list. For example, 3, 4, 6, 8 indicates those four specific integers.

The forward slash (/) can be used to specify step values. The value of an integer can be skipped within a range by following the range with /<integer>. For example, 0-59/2 can be used to define every other minute in the minute field. Step values can also be used with an asterisk. For instance, the value */3 can be used in the month field to run the task every third month.

Any lines that begin with a hash mark (#) are comments and are not processed.

Example 22-1. Examples of crontabs

# record the memory usage of the system every monday
# at 3:30AM in the file /tmp/meminfo
30 3 * * mon cat /proc/meminfo >> /tmp/meminfo
# run custom script the first day of every month at 4:10AM
10 4 1 * * /root/scripts/backup.sh

Logic will get you from A to B. Imagination will take you everywhere.

Link naar reactie
Delen op andere sites

Merci, hier ben ik inderdaad bekend mee.

 

Op een of andere manier is m'n script gewoon niet goed.

 

Inmiddels worden m'n plugins wel beeindigd, maar niet gestart:

 

Citaat:

#!/bin/sh

#

killall -9 newcs

sleep 5s

killall -9 mbox_module

sleep 5s

rm /tmp/share.onl

rm /tmp/share.info

/EMU/OpenXCAS/newcs/newcs -nd &

sleep 15s

/EMU/OpenXCAS/MboxCAS/mbox_module /EMU/OpenXCAS/MboxCAS/mbox.cfg &

 

Het werkt overigens wel als ik het script met de hand uitvoer....

DB800HD ~ AZBox HD Premium ~ Archsat 3/1 ~ Apple TV2 XBMC

Link naar reactie
Delen op andere sites

Als je de output van het script stuurt naar een textbestandje ergens, kan je dan zien of je een foutmelding krijgt?

 

dus aan het einde van het croncommando > /tmp/output.txt

 

Ik vind het namelijk maf dat het script met de hand wel draait, maar niet via cron...

Logic will get you from A to B. Imagination will take you everywhere.

Link naar reactie
Delen op andere sites

Ok, heb ik gedaan, en t gekke is, als ik dat toevoeg lijkt het script wel te draaien?

 

Het probleem in het script blijft echter wel dat newcs slecht afgesloten wordt. Soms blijft 1 van de 4 processen achter, >80% van de CPU wegsnoepend...

 

 

DB800HD ~ AZBox HD Premium ~ Archsat 3/1 ~ Apple TV2 XBMC

Link naar reactie
Delen op andere sites

Je zou een scriptje kunnen toevoegen aan jouw cronscript die een aantal keer newcs probeert te killen, b.v. zoiets als:

 

Code:
	i=9	while expr $i != 0 > /dev/null	do		if pidof newcs > /dev/null; killall newcs				else break;		fi		i=`expr $i - 1`		sleep 1	done

 

Dit script test 9 seconden lang (zie i=9) of alle newcs processen gekilled zijn. Zo niet, dan killed 'ie alsnog.

 

Kan niet uit ervaring zeggen of dit script werkt, want m'n Azbox zit in een RMA procedure ;-)

Logic will get you from A to B. Imagination will take you everywhere.

Link naar reactie
Delen op andere sites

Heb inmiddels het script opgesplits in 2 delen.

 

Het eerste script, for mbox, doet z'n werk prima. Mbox wordt nu iedere nacht herstart.

 

Voor newcs lukt het me echter nog steeds niet. Krijg ook volstrekt geen entries in de output-file die ik in crontab gedefinieerd heb. Ik zie wel dat het bestand 'aangeraakt' is op de geplande tijd, maar verder niets...

 

Het newcs cron script vanaf de CLI uitvoeren werkt prima...

 

newcs cron script:

Code:
#!/bin/sh#killall -9 newcssleep 15s/EMU/OpenXCAS/newcs/newcs -nd &

 

Nog iemand een helder idee?

 

 

DB800HD ~ AZBox HD Premium ~ Archsat 3/1 ~ Apple TV2 XBMC

Link naar reactie
Delen op andere sites

Maak een account aan of log in om te reageren

Je moet een lid zijn om een reactie te kunnen achterlaten

Account aanmaken

Registreer voor een nieuwe account in onze community. Het is erg gemakkelijk!

Registreer een nieuwe account

Inloggen

Heb je reeds een account? Log hier in.

Nu inloggen
  • Wie is er online   0 leden

    • Er zijn geen geregistreerde gebruikers deze pagina aan het bekijken
×
×
  • Nieuwe aanmaken...