Crontab non fonctionnel sur debian 5 server ?

bonjour, je suis en train de configurer une dédibox sous debian 5 et j ai une tache que j aimerai automatiser, j’essaie donc d utiliser crontab :
en faisant crontab -e ca ne fonctionne pas
en éditant etc/crontab ca ne fonctionne pas plus,
j ai beau chercher sur tous les tutoriaux que je trouve via google aucun ne m aide plus.
quelqu un aurait une idée ?

pour info voici ma ligne inclue dans crontab :
30 12 * * * root find /home/alboon/sabfolder/downloads/complete -ctime 5 -exec rm -rf {} ;

ps: la commande seule fonctionne à merveille

[quote=“al_boon”]pour info voici ma ligne inclue dans crontab :
30 12 * * * root find /home/alboon/sabfolder/downloads/complete -ctime 5 -exec rm -rf {} ;[/quote]
Pourquoi root ?

juste une idée, essaye avec /usr/bin/find

[quote=“AnatomicJC”][quote=“al_boon”]pour info voici ma ligne inclue dans crontab :
30 12 * * * root find /home/alboon/sabfolder/downloads/complete -ctime 5 -exec rm -rf {} ;[/quote]
Pourquoi root ?[/quote]

oui j aurai du préciser, je ne met root que dans etc/crontab, comme les autres commande qui s y trouvaient deja.

effectivement les commande au dessus mettent le chemin complet de la commande, je vais donc essayer usr/bin/find

merci de vos réponses je posterai si cela fonctionne

Si jamais cela ne fonctionne pas, regarde les mails de root.
Quand une tâche cron affiche quelque chose, elle l’envoie à l’utilisateur qui exécute la tâche par mail.

avis personnel :

je trouve plus commode de demander a cron de lancer un script plutôt que lancer directement une commande.
déja tu commences ton script en donnant le path comme ça pas de problème de chemin absolu / relatif. et c’est plus facile d’aller modifier le script que de tripoter les crontab.

Je suis du même avis

si ca ne fonctionne toujours pas j essayerai ce soir, merci de vos réponses

bon, rien ne fonctionne, je desespere un peu :’(

meme en passant par un script.

voici les commande que j utilise:

[quote]# /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 /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
@reboot root /home/alboon/scripts/webminstart.sh
[/quote]

le fichier .sh qui va avec :

[quote]#!/bin/bash

/etc/webmin/start[/quote]

ou en modifiant crontab -e :

[quote]33 14 * * * /etc/webmin/cron/tempdelete.pl
@reboot /usr/bin/find /home/alboon/sabfolder/downloads/complete -ctime 4 -exec $
@reboot /home/alboon/scripts/webminstart.sh
34 14 * * * /usr/bin/find /home/alboon/sabfolder/downloads/imcomplete -ctime 5 $
35 14 * * * /usr/bin/find /home/alboon/sabfolder/nzb_old -ctime 5 -exec rm -rf $
@reboot /etc/webmin/start%/etc/webmin/start #d�marrage de webmin[/quote]

la derniere ligne étant crée via webmin donc téhoriquement valide.

mes commandes fonctionnent sans problème quand je les fais à la main

j ai même installé mailutils lisant quelque part qu il était necessaire.

bon j ai un premier élément de réponse, apparement cron ne se lance pas au démarrage

si je fais /etc/init.d/./cron stop && /etc/init.d/./cron start
il met un erreur pour le stop et démarre ensuite crond
et hop comme par magie ma commande s est effectué, je vais voir pour le rajouter au boot :wink:

bizzard il est bien config poru se lancer au démarrage mais rien n y fait.

voici le script de démarrage :

[code]#!/bin/sh

Start/stop the cron daemon.

BEGIN INIT INFO

Provides: cron

Required-Start: $remote_fs $syslog $time

Required-Stop: $remote_fs $syslog $time

Default-Start: 2 3 4 5

Default-Stop: 1

Short-Description: Regular background program processing daemon

Description: cron is a standard UNIX program that runs user-specified

programs at periodic scheduled times. vixie cron adds a

number of features to the basic UNIX cron, including better

security and more powerful configuration options.

END INIT INFO

test -f /usr/sbin/cron || exit 0

PIDFILE=/var/run/crond.pid

In some systems the pidfile might be (incorrectly) set to /etc

if this pidfile is present, use it instead.

[ -e /etc/cron.pid ] && PIDFILE=/etc/crond.pid
[ -r /etc/default/cron ] && . /etc/default/cron

. /lib/lsb/init-functions

Read the system’s locale and set cron’s locale. This locale

will be inherited by cron (used to set charset of emails)

and tasks running under it.

parse_environment ()
{
ENV_FILE=“none”
[ -r /etc/environment ] && ENV_FILE="/etc/environment"
[ -r /etc/default/locale ] && ENV_FILE="/etc/default/locale"
[ $ENV_FILE = none ] && return

for var in LANG LC_ALL LC_CTYPE; do
    value=$(egrep "^[^#]*${var}=" $ENV_FILE | tail -n1 | cut -d= -f2)
    eval $var=$value
done

}

Parse the system’s environment

if [ “$READ_ENV” = “yes” ] ; then
export LANG LC_ALL LC_CTYPE
parse_environment
fi

case “$1” in
start) log_daemon_msg “Starting periodic command scheduler” "crond"
start-stop-daemon --start --quiet --pidfile $PIDFILE --name cron --startas /usr/sbin/cron – $LSBNAMES $EXTRA_OPTS
log_end_msg $?
;;
stop) log_daemon_msg “Stopping periodic command scheduler” "crond"
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name cron
log_end_msg $?
;;
restart) log_daemon_msg “Restarting periodic command scheduler” "crond"
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name cron
start-stop-daemon --start --quiet --pidfile $PIDFILE --name cron --startas /usr/sbin/cron – $LSBNAMES $EXTRA_OPTS
log_end_msg $?
;;
reload|force-reload) log_daemon_msg “Reloading configuration files for periodic command scheduler” “crond”
# cron reloads automatically
log_end_msg 0
;;
*) log_action_msg "Usage: /etc/init.d/cron {start|stop|restart|reload|force-reload}"
exit 2
;;
esac
exit 0
[/code]

[quote=“al_boon”]bizzard il est bien config poru se lancer au démarrage mais rien n y fait.

voici le script de démarrage :

[code]#!/bin/sh

Start/stop the cron daemon.

BEGIN INIT INFO

Provides: cron

Required-Start: $remote_fs $syslog $time

Required-Stop: $remote_fs $syslog $time

Default-Start: 2 3 4 5

Default-Stop: 1

Short-Description: Regular background program processing daemon

Description: cron is a standard UNIX program that runs user-specified

programs at periodic scheduled times. vixie cron adds a

number of features to the basic UNIX cron, including better

security and more powerful configuration options.

END INIT INFO

test -f /usr/sbin/cron || exit 0

PIDFILE=/var/run/crond.pid

In some systems the pidfile might be (incorrectly) set to /etc

if this pidfile is present, use it instead.

[ -e /etc/cron.pid ] && PIDFILE=/etc/crond.pid
[ -r /etc/default/cron ] && . /etc/default/cron

. /lib/lsb/init-functions

Read the system’s locale and set cron’s locale. This locale

will be inherited by cron (used to set charset of emails)

and tasks running under it.

parse_environment ()
{
ENV_FILE=“none”
[ -r /etc/environment ] && ENV_FILE="/etc/environment"
[ -r /etc/default/locale ] && ENV_FILE="/etc/default/locale"
[ $ENV_FILE = none ] && return

for var in LANG LC_ALL LC_CTYPE; do
    value=$(egrep "^[^#]*${var}=" $ENV_FILE | tail -n1 | cut -d= -f2)
    eval $var=$value
done

}

Parse the system’s environment

if [ “$READ_ENV” = “yes” ] ; then
export LANG LC_ALL LC_CTYPE
parse_environment
fi

case “$1” in
start) log_daemon_msg “Starting periodic command scheduler” "crond"
start-stop-daemon --start --quiet --pidfile $PIDFILE --name cron --startas /usr/sbin/cron – $LSBNAMES $EXTRA_OPTS
log_end_msg $?
;;
stop) log_daemon_msg “Stopping periodic command scheduler” "crond"
start-stop-daemon --stop --quiet --pidfile $PIDFILE --name cron
log_end_msg $?
;;
restart) log_daemon_msg “Restarting periodic command scheduler” "crond"
start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE --name cron
start-stop-daemon --start --quiet --pidfile $PIDFILE --name cron --startas /usr/sbin/cron – $LSBNAMES $EXTRA_OPTS
log_end_msg $?
;;
reload|force-reload) log_daemon_msg “Reloading configuration files for periodic command scheduler” “crond”
# cron reloads automatically
log_end_msg 0
;;
*) log_action_msg "Usage: /etc/init.d/cron {start|stop|restart|reload|force-reload}"
exit 2
;;
esac
exit 0
[/code][/quote]

je sais que pour proftpd j avais du bidouiller pour remettre de l ordre dans le lancement arrete selon le niveau de lancement de l os (rc1 rc2 etc etc)
je vais chercher par la mais je ne me souviens plus trop

résolu :d

je m explique pour ceux qui pourrait en avoir besoin,
pour démarrer le script de démarrage doit se trouver dans les dossier rc0-6.d mia aussi dans le dossier rcS.d et moi il manquait certain script de démarrage donc voila c est reglé
merci de votre aide