PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > linux.debian.user > Question about using anacron with cron
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
linux.debian.user debian-user@lists.debian.org.

Question about using anacron with cron

Réponse
 
LinkBack Outils de la discussion
Vieux 08/03/2007, 17h40   #1
richbl
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Question about using anacron with cron

Hello all,

I have a question about cron and anancron.

After reading the man page for both cron/crontab and anacron/
anacrontab, it's not clear to me how to configure for the following:

--jobs to run currently live in /etc/crontab
--jobs need to run serially (hence the staggered start times in
crontab)

As I understand it, anacron will only run those jobs created as
scripts in the **ly folders (e.g. /etc/cron.weekly).

So, my question is this: if I have periodic jobs to run in /etc/
crontab, how do I have anacron run those jobs when cron fails to do so
(e.g. machine turned off)?

It seems to me that the only way anacron will do what I expect it to
do is to move my jobs in /etc/crontab into /etc/cron.daily. Yet, if I
do that, I lose the ability to have jobs run serially (or at least run
the risk of having jobs overlap each other).

Please advise.

Thanks.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 08/03/2007, 18h00   #2
Andrew Sackville-West
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Question about using anacron with cron

On Thu, Mar 08, 2007 at 09:15:12AM -0800, richbl wrote:
> Hello all,
>
> I have a question about cron and anancron.
>
> After reading the man page for both cron/crontab and anacron/
> anacrontab, it's not clear to me how to configure for the following:
>
> --jobs to run currently live in /etc/crontab
> --jobs need to run serially (hence the staggered start times in
> crontab)
>
> As I understand it, anacron will only run those jobs created as
> scripts in the **ly folders (e.g. /etc/cron.weekly).
>
> So, my question is this: if I have periodic jobs to run in /etc/
> crontab, how do I have anacron run those jobs when cron fails to do so
> (e.g. machine turned off)?
>
> It seems to me that the only way anacron will do what I expect it to
> do is to move my jobs in /etc/crontab into /etc/cron.daily. Yet, if I
> do that, I lose the ability to have jobs run serially (or at least run
> the risk of having jobs overlap each other).


I can't answer your cron/anacron questions directly, but why not just
wrap your cron jobs in a script that runs them sequentially? then you
can just run that script from cron/anacron and not worry about it.

.02

A

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFF8E5paIeIEqwil4YRAjjLAJ9viX4cSK/AdsQQTnaMSJUYBZuMsQCg1lLr
p2nwZLiAwVq1wEp5/EPSzdg=
=P1Qy
-----END PGP SIGNATURE-----

  Réponse avec citation
Vieux 08/03/2007, 19h30   #3
Cédric Lucantis
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Question about using anacron with cron


> > I have a question about cron and anancron.
> >
> > After reading the man page for both cron/crontab and anacron/
> > anacrontab, it's not clear to me how to configure for the following:
> >
> > --jobs to run currently live in /etc/crontab
> > --jobs need to run serially (hence the staggered start times in
> > crontab)
> >
> > As I understand it, anacron will only run those jobs created as
> > scripts in the **ly folders (e.g. /etc/cron.weekly).


not only, you can run a script from anywhere by editing /etc/anacrontab (see
man anacrontab)

> >
> > So, my question is this: if I have periodic jobs to run in /etc/
> > crontab, how do I have anacron run those jobs when cron fails to do so
> > (e.g. machine turned off)?


use cron _or_ anacron, not both!

> > It seems to me that the only way anacron will do what I expect it to
> > do is to move my jobs in /etc/crontab into /etc/cron.daily. Yet, if I
> > do that, I lose the ability to have jobs run serially (or at least run
> > the risk of having jobs overlap each other).


jobs in /etc/cron.daily are run one by one in lexicographic order, so you just
have to prepend their name with a number (01first_script, 02second_script...)
to order them (see man run-parts)

>
> I can't answer your cron/anacron questions directly, but why not just
> wrap your cron jobs in a script that runs them sequentially? then you
> can just run that script from cron/anacron and not worry about it.
>


seems to be a good solution too

--
Cédric Lucantis
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h40.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09056 seconds with 11 queries