CRON ne retourne pas le output de mon script dans mon mail

Bonjour à tous :slightly_smiling:

Voici mon problème, je souhaite faire des scripts qui vont m’envoyer un email contenant le résultat demander.
Jusque là tout va bien, cependant lorsque j’applique ce script à une CRON, le output de mon mail est vierge, comme si la CRON gardée le contenu :confused:

Debian Linux 6.0
Linux 2.6.32-5-amd64 sur x86_64

Mon script ressemble à ça =>

echo /var/log/auth.log find /var/log/auth.log | xargs grep -s "Accepted password for" echo - Check done @ $(date +%d-%m-%y_%H:%M)

Ma commande passée en CRON et la suivante =>

Lorsque je procède donc en commande en SSH, pas de soucis, je reçois bien un mail avec le contenu souhaité, cependant par la CRON, je reçois un mail vide :confused:

Une idée du point qui pose problème ?

Merci d’avance

Salut,

[mono]$ man cron[/mono]

[quote=“crontab”]# crontab -e

Edit this file to introduce tasks to be run by cron.

Each task to run has to be defined through a single line

indicating with different fields when the task will be run

and what command to run for the task

To define the time you can provide concrete values for

minute (m), hour (h), day of month (dom), month (mon),

and day of week (dow) or use ‘*’ in these fields (for ‘any’).#

Notice that tasks will be started based on the cron’s system

daemon’s notion of time and timezones.

Output of the crontab jobs (including errors) is sent through

email to the user the crontab file belongs to (unless redirected).

For example, you can run a backup of all your user accounts

at 5 a.m every week with:

0 5 * * 1 tar -zcf /var/backups/home.tgz /home/

For more information see the manual pages of crontab(5) and cron(8)

m h dom mon dow command

MAILTO=blabla@blabla.net

[…][/quote]

[quote=“BelZéButh”]Salut,

[mono]$ man cron[/mono]

[quote=“crontab”]# crontab -e

Edit this file to introduce tasks to be run by cron.

Each task to run has to be defined through a single line

indicating with different fields when the task will be run

and what command to run for the task

To define the time you can provide concrete values for

minute (m), hour (h), day of month (dom), month (mon),

and day of week (dow) or use ‘*’ in these fields (for ‘any’).#

Notice that tasks will be started based on the cron’s system

daemon’s notion of time and timezones.

Output of the crontab jobs (including errors) is sent through

email to the user the crontab file belongs to (unless redirected).

For example, you can run a backup of all your user accounts

at 5 a.m every week with:

0 5 * * 1 tar -zcf /var/backups/home.tgz /home/

For more information see the manual pages of crontab(5) and cron(8)

m h dom mon dow command

MAILTO=blabla@blabla.net

[…][/quote][/quote]

Salut BelZéButh, et merci pour ta réponse, cependant elle ne m’aide pas.

J’ai par défaut désactivé l’envoi de mail par les commandes CRON (ceci est même natif en version serveur je crois bien), car elle génère des spams avec certaines routines.
J’aimerais donc simplement pouvoir exploiter ma ligne de commande indiquée, car elle fonctionne très bien sous d’autres serveurs dédiés.
Je ne sais donc pas à quel niveau, mais il y à un détail qui m’échappe.