cron


Rispondi
Avatar utente
ale
Mac
Messaggi: 6797
Iscritto il: 27 apr 2001, 20:31
Località: Romanengo
Contatta:

cron

Messaggio da ale » 25 giu 2008, 12:28

come funziona?
come decide a quale minuto, ora, giorno eseguire le operazioni?
dipende dal momento dell'accensione?
hourly lo fa ogni ora dall'accensione?
daily lo fa ogni 24 ore dall'accensione? lo fa a mezzanotte?
yearly lo fa ogni 365x24 ore dall'accensione? lo fa il giorno di natale?
come funziona?
Ultima modifica di ale il 25 giu 2008, 14:44, modificato 1 volta in totale.
E pluribus unum

Avatar utente
nikez
Nudo
Messaggi: 3498
Iscritto il: 21 apr 2002, 14:11
Località: Vaiano
Contatta:

Messaggio da nikez » 25 giu 2008, 14:28

è tutto in /etc/crontab

http://www.unixgeeks.org/security/newbi ... ron-1.html

minute hour dom month dow user cmd

minute This controls what minute of the hour the command will run on,
and is between '0' and '59'
hour This controls what hour the command will run on, and is specified in
the 24 hour clock, values must be between 0 and 23 (0 is midnight)
dom This is the Day of Month, that you want the command run on, e.g. to
run a command on the 19th of each month, the dom would be 19.
month This is the month a specified command will run on, it may be specified
numerically (0-12), or as the name of the month (e.g. May)
dow This is the Day of Week that you want a command to be run on, it can
also be numeric (0-7) or as the name of the day (e.g. sun).
user This is the user who runs the command.
cmd This is the command that you want run. This field may contain
multiple words or spaces.

If you don't wish to specify a value for a field, just place a * in the
field.

e.g.
01 * * * * root echo "This command is run at one min past every hour"
17 8 * * * root echo "This command is run daily at 8:17 am"
17 20 * * * root echo "This command is run daily at 8:17 pm"
00 4 * * 0 root echo "This command is run at 4 am every Sunday"
* 4 * * Sun root echo "So is this"
42 4 1 * * root echo "This command is run 4:42 am every 1st of the month"
01 * 19 07 * root echo "This command is run hourly on the 19th of July"
/* NO COMMENT */

Avatar utente
Ego
D-ai-i-go
Messaggi: 4211
Iscritto il: 15 nov 2001, 11:15
Contatta:

Messaggio da Ego » 25 giu 2008, 14:31

chron? non cron?

se è cron vedi crontab :P

lo uso ogni tanto la sintassi la vedi facendo: crontab -e
Solitamente c'è una riga commentata con l'esempio.

Vado a memoria dovrebbe essere: mm hh dom mon dow command
mm = minuti
hh = ore

esempio vuoi che venga eseguito alle 23:15 mm=15 hh=23

dom = giorno del mese (data)
mon= mese
dow= da 1 a 7 sono lunedì martedì eccetera (non ricordo se 1 è lunedì o domenica)

et infine il comando da eseguire.
mi pare che se un campo non lo usi ci devi mettere asterisco.

MA non sono sicuro che è quasto che stai chiedendo :D.
Che è chron? :D
A canvas to paint, to degenerate
Dark reflections - degeneration
A canvas to paint, to denigrate
Dark reflections, of dark foul light
Carcass

Avatar utente
Ego
D-ai-i-go
Messaggi: 4211
Iscritto il: 15 nov 2001, 11:15
Contatta:

Messaggio da Ego » 25 giu 2008, 14:31

ops il nikez mi ha preceduto :D.
A canvas to paint, to degenerate
Dark reflections - degeneration
A canvas to paint, to denigrate
Dark reflections, of dark foul light
Carcass

Avatar utente
nikez
Nudo
Messaggi: 3498
Iscritto il: 21 apr 2002, 14:11
Località: Vaiano
Contatta:

Messaggio da nikez » 25 giu 2008, 14:32

se ti ho preceduto vuol dire che mi stai dietro...brrrr
/* NO COMMENT */

Avatar utente
ale
Mac
Messaggi: 6797
Iscritto il: 27 apr 2001, 20:31
Località: Romanengo
Contatta:

Messaggio da ale » 25 giu 2008, 14:44

Ego ha scritto:chron? non cron?
ok tutto risolto! ecco perché google mi consigliava morbi invece che spiegazioni.
grazie! correggo il titolo del topic per i posteri.
grazie delle risposte!
E pluribus unum

Avatar utente
Ego
D-ai-i-go
Messaggi: 4211
Iscritto il: 15 nov 2001, 11:15
Contatta:

Messaggio da Ego » 25 giu 2008, 16:42

eh eh eh anche io ho cercato per scrupolo il chron... avevo il dubbio stessi cercando altro e ho trovato solo morbi :D.

nikez rabbrividisco quanto te... ma cùmé al dìsia me nòno: mèi dàl che ciapal!

:lol:
A canvas to paint, to degenerate
Dark reflections - degeneration
A canvas to paint, to denigrate
Dark reflections, of dark foul light
Carcass

Rispondi