Problème Crontab et Tshark
cmoimath
Messages postés
53
Statut
Membre
-
cmoimath Messages postés 53 Statut Membre -
cmoimath Messages postés 53 Statut Membre -
Bonjour,
Je suis actuellement en stage, je réalise une sonde réseau.
Le principe:tshark sonde le réseau à certaines heure et je récupère les statistiques, pour cela je souhaite effectuer un script périodiquement. J'ai donc voulu utiliser l'utilitaire crontab mais cela ne marche pas.
en effet si je veux exectuer une commande tshark avec crontab rien ne se passe alors que si je l'excute dans un terminal la commande marche à merveille, j'ai beau chercher je ne trouve pas l'erreur.
pouvez vous m'aider svp.
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /et$
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /et$
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /et$
0 12,15,16 * * * root tshark -i eth0 -a duration:400 > ~/sonde.txt
#
voici le contenu de crontab.
NB: je suis obliger d'effectuer la commande tshark en root sinon il ne veux pas lancer de capture
Je suis actuellement en stage, je réalise une sonde réseau.
Le principe:tshark sonde le réseau à certaines heure et je récupère les statistiques, pour cela je souhaite effectuer un script périodiquement. J'ai donc voulu utiliser l'utilitaire crontab mais cela ne marche pas.
en effet si je veux exectuer une commande tshark avec crontab rien ne se passe alors que si je l'excute dans un terminal la commande marche à merveille, j'ai beau chercher je ne trouve pas l'erreur.
pouvez vous m'aider svp.
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /et$
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /et$
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /et$
0 12,15,16 * * * root tshark -i eth0 -a duration:400 > ~/sonde.txt
#
voici le contenu de crontab.
NB: je suis obliger d'effectuer la commande tshark en root sinon il ne veux pas lancer de capture
A voir également:
- Problème Crontab et Tshark
- Crontab toutes les minutes - Forum Shell
- [Script shell] crontab ✓ - Forum Shell
- Crontab toute les heures ✓ - Forum Shell
- Crontab toutes les heures sauf de 3h à 6h ✓ - Forum Shell
- Crontab toutes les 5 minutes - Forum Shell