Crontab ne marche pas..

HmidoRapido -  
linuxnico Messages postés 206 Statut Membre -
Bonjour,

quand je tappe sudo nano /etc/crontab
j'obtient

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# 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
0,20,40 * * * *  root mv /home/monsite/public_html/msn/index.php 
/home/monsite/public_html/msn/indexfr.php | mv 
/home/monsite/public_html/msn/indexcons.php /home/monsite/public_html/msn/index.php
0,20,40 * * * *  root service exim stop | service exim restart | service 
exim restart
1,21,41 * * * * root echo "Server 2 is under maintenance my god.." | 
mail monsite@gmail.com
5,25,45 * * * * root mv /home/monsite/public_html/msn/index.php 
/home/monsite/public_html/msn/indexcons.php | mv 
/home/monsite/public_html/msn/indexfr.php /home/monsite/pulic_html/msn/index.php 
6,26,46 * * * * root echo "My god.. Sorry for disturbing you ..its just 
the Server 2.. he Is UP again and can send mails to hotmail" | 
mail monsite@gmail.com;monsite1@hotmail.com



Y a til une erreur dans le crontab? car ça ne marche pas du tout...


Merci d'avance

2 réponses

papavers Messages postés 24 Statut Membre 1
 
Salut

Tu peux préciser stp ce que tu veux faire exactement avec crontab (la tâche à exécuter, et par quel utilisateur).

Mais si je me trompe pas, /etc/crontab est utilisé pour faire appel aux scrpts dans les répertoires /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, /etc/cron.monthly...(moi je suis sous solaris, et j'utilise pas ce fichier)
0
linuxnico Messages postés 206 Statut Membre 10
 
alors plusieur problemes:

0,20,40 * * * * root service exim stop | service exim restart | service exim restart

entre 0 20 et 40, il n'y a pas de ","

0 corresponds aux minutes
20 corresponds aux heures
40 normalement corresponds au jour dans le mois (donc de 1 a 31 max)


change ca et ca devrait etre bon :)
0