Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
come far partire qualsiasi script all'avvio
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
idonda
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2004
Posts: 134

PostPosted: Mon May 30, 2005 7:55 am    Post subject: come far partire qualsiasi script all'avvio Reply with quote

ho letto la documentazione sul mirror del rsync e ho visto lo script per aggiornare automaticamente il portage...
premesso che non ho mai fatto scripts e non so come avviarli, vorrei capire dove e come mettere un qualsiasi script per renderlo avviabile al boot ed in modo che funzioni sempre... unoscript com quello dell'aggiornamento di portage, dovrebbefunzionare ad ogni intervallo di tempo...ma come mi chiedo?

e sempre in tema di mirror rsync, dove si mette lo script perl per la verifica degli abusers?... e come si avvia? e come fa a funzionare sempre?

ringrazio anticipatamente.
Back to top
View user's profile Send private message
federico
Advocate
Advocate


Joined: 18 Feb 2003
Posts: 3272
Location: Italy, Milano

PostPosted: Mon May 30, 2005 8:03 am    Post subject: Reply with quote

La tua soluzione e' divisa in due parti.
All'avvio i servizi vengono avviati tramite programmi di avvio che si trovano sotto /etc/init.d
Per lanciare quei programmi devi sym linkarli nei varii runlevel, a seconda di quando ti interessa che partano.
Puoi facilitare questa cosa col comando rc-update; ad esempio rc-update add tuoprogrammasottoinitd default fara' si che questo si avvii al boot del pc.

Per quello che riguarda invece l'esecuzione dei programmi a scadenze di tempo determinato a macchina gia' avviata quello che ti serve e' "cron" ; per il suo utilizzo ti rimando alla documentazione e ai post presenti sul forum.

Fede
_________________
Sideralis www.sideralis.org
Pic http://blackman.amicofigo.com/gallery
Arduino http://www.arduino.cc
Chi aveva potuto aveva spaccato
2000 pezzi buttati là
Molti saluti,qualche domanda
Semplice come musica punk
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Mon May 30, 2005 9:06 am    Post subject: Reply with quote

federico wrote:
Per quello che riguarda invece l'esecuzione dei programmi a scadenze di tempo determinato a macchina gia' avviata quello che ti serve e' "cron" ; per il suo utilizzo ti rimando alla documentazione e ai post presenti sul forum.

Questo serve piu' che altro sulle macchine che sono sempre accese
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
federico
Advocate
Advocate


Joined: 18 Feb 2003
Posts: 3272
Location: Italy, Milano

PostPosted: Mon May 30, 2005 10:46 am    Post subject: Reply with quote

Immagino che sia il suo caso, se ho capito bene vuole provare a fare un mirror di portage on line, giusto?
_________________
Sideralis www.sideralis.org
Pic http://blackman.amicofigo.com/gallery
Arduino http://www.arduino.cc
Chi aveva potuto aveva spaccato
2000 pezzi buttati là
Molti saluti,qualche domanda
Semplice come musica punk
Back to top
View user's profile Send private message
fabius
Guru
Guru


Joined: 29 Nov 2004
Posts: 525

PostPosted: Mon May 30, 2005 11:41 am    Post subject: Reply with quote

fedeliallalinea wrote:
Questo serve piu' che altro sulle macchine che sono sempre accese

Alcune varianti di cron, come fcron, gestiscono anche il caso in cui la macchina è spenta ovvero eseguono il job la volta successiva che viene accesa
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Mon May 30, 2005 12:17 pm    Post subject: Reply with quote

fabius wrote:

Alcune varianti di cron, come fcron, gestiscono anche il caso in cui la macchina è spenta ovvero eseguono il job la volta successiva che viene accesa


In questo caso è possibile usare anacron:

Code:

*  sys-process/anacron
      Latest version available: 2.3
      Latest version installed: 2.3
      Size of downloaded files: 23 kB
      Homepage:    http://anacron.sourceforge.net/
      Description: a periodic command scheduler
      License:     as-is

_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
fabius
Guru
Guru


Joined: 29 Nov 2004
Posts: 525

PostPosted: Mon May 30, 2005 12:25 pm    Post subject: Reply with quote

gutter wrote:
In questo caso è possibile usare anacron:

anche, dipende dalle preferenze :)
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Mon May 30, 2005 12:29 pm    Post subject: Reply with quote

fabius wrote:

anche, dipende dalle preferenze :)


Questo senza dubbio ;)

/me usa cron/anacron :D
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
idonda
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2004
Posts: 134

PostPosted: Mon May 30, 2005 7:51 pm    Post subject: Reply with quote

quindi lo script per il sync automatico lo devo far riavviare con cron!
Back to top
View user's profile Send private message
gutter
Bodhisattva
Bodhisattva


Joined: 13 Mar 2004
Posts: 7162
Location: Aarau, Aargau, Switzerland

PostPosted: Mon May 30, 2005 8:48 pm    Post subject: Reply with quote

idonda wrote:
quindi lo script per il sync automatico lo devo far riavviare con cron!


Si, lo puoi anche fare.
_________________
Registered as User #281564 and Machines #163761
Back to top
View user's profile Send private message
idonda
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2004
Posts: 134

PostPosted: Mon May 30, 2005 10:09 pm    Post subject: Reply with quote

gutter wrote:
idonda wrote:
quindi lo script per il sync automatico lo devo far riavviare con cron!


Si, lo puoi anche fare.


ok cioè c'è un modo migliore?...

cmq mi leggo la documentazione per cron
Back to top
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Tue May 31, 2005 1:28 am    Post subject: Reply with quote

mettere emerge sync al boot e' male.
1. ti inchioda la macchina (il disco) al boot, rendendolo una pena.
2. e se riavvii 3-4 volte in un giorno? synchi altrettante volte? nononono. e' bonton non syncare piu di una volta al giorno.
la soluzione e'
Code:
echo '#! /bin/sh' > /etc/cron.daily/sync
echo '/usr/bin/emerge sync 2>/dev/null 1>/dev/null' >> /etc/cron.daily/sync
chmod u+x /etc/cron.daily/sync

_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
idonda
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2004
Posts: 134

PostPosted: Tue May 31, 2005 8:04 am    Post subject: Reply with quote

FonderiaDigitale wrote:
mettere emerge sync al boot e' male.
1. ti inchioda la macchina (il disco) al boot, rendendolo una pena.
2. e se riavvii 3-4 volte in un giorno? synchi altrettante volte? nononono. e' bonton non syncare piu di una volta al giorno.
la soluzione e'
Code:
echo '#! /bin/sh' > /etc/cron.daily/sync
echo '/usr/bin/emerge sync 2>/dev/null 1>/dev/null' >> /etc/cron.daily/sync
chmod u+x /etc/cron.daily/sync


di questa sintassi non ho capito nulla perchè ancora non ho letto la doc di cron. comuqnue io lascio la mia macchina sempre up perchè mi serve per bypassare wireless lan non sicure all'università, fare server delle foto e di files...

comunque ripeto mi do un occhiata a cron e poi magari riesco a dare un sync al giorno com'è giusto.. tra l'altro così il server mi fa da mirror per il portatile.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum