Précédent   Forum des professionnels en informatique > Systèmes > Linux > Applications > Shell
Shell Vos questions sur l'utilisation des commandes shell
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 03/08/2007, 13h33   #1
Membre actif
 
Homme Arnaud
Inscription : décembre 2006
Messages : 871
Détails du profil
Informations personnelles :
Nom : Homme Arnaud
Âge : 27
Localisation : France, Seine Maritime (Haute Normandie)

Informations forums :
Inscription : décembre 2006
Messages : 871
Points : 195
Points : 195
Par défaut Problème avec CRONTAB

Bonjour,

J'ai planifié une tache avec "crontab -e"
*/1 * * * * root /home/root/scripts/ressources.sh

Ma tache ne s'execute jamais.

J'ai regardé mes emails et j'ai récu cet email concernant crontab :

From root@localhost.localdomain Fri Aug 3 16:02:02 2007
Date: Fri, 3 Aug 2007 16:02:01 +0200
From: root@localhost.localdomain (Cron Daemon)
To: root@localhost.localdomain
Subject: Cron <root@localhost> root /home/root/scripts/ressources.sh
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>

/bin/sh: root: command not found


Je ne comprend pas pourquoi il me dit "/bin/sh: root: command not found" !!

Auriez vous une idée pour résoudre mon problème

Merci d'avance

Arnaud
__________________
www.SonolightDj.com
Prestataire sonorisation et lumière
arnaudperfect est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/08/2007, 16h00   #2
Membre habitué
 
Avatar de vdemeester
 
Inscription : mai 2003
Messages : 110
Détails du profil
Informations personnelles :
Âge : 27

Informations forums :
Inscription : mai 2003
Messages : 110
Points : 108
Points : 108
Citation:
Envoyé par arnaudperfect
Bonjour,

J'aimerai savoir qu'elle est la procédure exate pour planifier un script bash avec CRON ?

Qu'elles sont les modifications à apporter au fichier bash ? (chemin absolu pour les commande)

puis ensuite on édite le fichier cron, avec crontab.

P.S : j'ai déjà essayer de le faire avec le chemin absolu et crontab, mais cela ne fonctionne pas...

Merci d'avance

Arnaud
J'ai envie de dire
__________________
Linux/Unix, Emacs and Free Software are evil
GNU/Linux & FreeBSD powered user.
vdemeester est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/08/2007, 16h04   #3
Membre actif
 
Homme Arnaud
Inscription : décembre 2006
Messages : 871
Détails du profil
Informations personnelles :
Nom : Homme Arnaud
Âge : 27
Localisation : France, Seine Maritime (Haute Normandie)

Informations forums :
Inscription : décembre 2006
Messages : 871
Points : 195
Points : 195
Bah finalement oui, j'ai regardé sur google, comme je l'ai fais hier, mais meme ici au boulot, meme problème, la tache ne démare pas !

Voir mon 1er post que j'ai modifié vous explicant le soucie...
__________________
www.SonolightDj.com
Prestataire sonorisation et lumière
arnaudperfect est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/08/2007, 16h10   #4
Membre actif
 
Homme Arnaud
Inscription : décembre 2006
Messages : 871
Détails du profil
Informations personnelles :
Nom : Homme Arnaud
Âge : 27
Localisation : France, Seine Maritime (Haute Normandie)

Informations forums :
Inscription : décembre 2006
Messages : 871
Points : 195
Points : 195
Je pense avoir trouvé le problème :

J'ai lu sur un site qu'il falait indiquer avec quel utilisateur la tache devait etre executé, j'ai donc mis root.

Le soucie est que cron, interprète mon root (*/1 * * * * root /home/root/scripts/ressources.sh) comme fesant parti du chemin du script...

J'ai donc modifié mon insertion avec crontab :

*/1 * * * * /home/root/scripts/ressources.sh

Je vais voir se que cela donne, je vous tien au courant.
__________________
www.SonolightDj.com
Prestataire sonorisation et lumière
arnaudperfect est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/08/2007, 16h23   #5
Membre actif
 
Homme Arnaud
Inscription : décembre 2006
Messages : 871
Détails du profil
Informations personnelles :
Nom : Homme Arnaud
Âge : 27
Localisation : France, Seine Maritime (Haute Normandie)

Informations forums :
Inscription : décembre 2006
Messages : 871
Points : 195
Points : 195
Bon cette fois ci, j'ai un autre message d'erreur :

From root@localhost.localdomain Fri Aug 3 16:11:27 2007
Date: Fri, 3 Aug 2007 16:11:01 +0200
From: root@localhost.localdomain (Cron Daemon)
To: root@localhost.localdomain
Subject: Cron <root@localhost> /home/root/scripts/ressources.sh
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>

TERM environment variable not set.
/usr/bin/logname: no login name


Je supose que je ne dois pas utiliser la variable logname, mais bon je vais pas totu réécrire mes scripts ! comment je peux viré les variables prédéfinies dans cron ?
__________________
www.SonolightDj.com
Prestataire sonorisation et lumière
arnaudperfect est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 17h26.


 
 
 
 
Partenaires

Hébergement Web