Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 28/12/2013, à 10:14

Compte anonymisé

[Résolu] anacron ne veut pas lancer mon script

Bonjour,

j'en suis déjà sur le soucis depuis 7 jours. ça commence à m’énerver sérieusement.

Ma machine n'est pas constamment allumé.  J'aimerai une sauvegarde journalière au cas ou.

donc j'ai créer ce script :

christophe-PC christophe # cat /etc/cron.daily/sauvegarde-luckybackup 
#!/bin/sh
su christophe -c '/usr/bin/luckybackup -c --no-questions --skip-critical /home/christophe/.luckyBackup/profiles/default.profile' > /home/christophe/.luckyBackup/logs/default-LastCronLog.log 2>&1

Je pense qu'il est à la bonne place pour cron et il fonctionne manuellement.

par contre si je lance

christophe-PC christophe # sudo su
christophe-PC christophe # anacron -fs

donc je suis en root, anacron ne lance rien. Pourtant je le force avec l'argument "f".
Il n'y a rien qui se passe.

Juste pour une précision, d'àpres ce que j'ai pu lire c'est anacron qui lance les cron.daily

Merci de votre aide.

Dernière modification par cleloup (Le 28/12/2013, à 10:44)

#2 Le 28/12/2013, à 10:32

Compte anonymisé

Re : [Résolu] anacron ne veut pas lancer mon script

J'avance.

[1]christophe@christophe-PC:~ > cat /etc/anacrontab 
# /etc/anacrontab: configuration file for anacron

# See anacron(8) and anacrontab(5) for details.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
HOME=/root
LOGNAME=root

# These replace cron's entries
1       5       cron.daily      run-parts --report /etc/cron.daily
7       10      cron.weekly     run-parts --report /etc/cron.weekly
@monthly        15      cron.monthly    run-parts --report /etc/cron.monthly

quand je lance cette commande :

run-parts --report /etc/cron.daily

en root

Effectivement ça fonctionne.

Donc pourquoi anacron ne me le fais pas manuellement ou même en automatique?

edit :

le soucis ne vient pas d'anacron. voir la sortie en dessous :

christophe@christophe-PC:~ > sudo anacron -f -n -d
Anacron 2.3 started on 2013-12-28
Will run job `cron.daily'
Will run job `cron.weekly'
Will run job `cron.monthly'
Jobs will be executed sequentially
Job `cron.daily' started
Job `cron.daily' terminated
Job `cron.weekly' started
Job `cron.weekly' terminated
Job `cron.monthly' started
Job `cron.monthly' terminated
Normal exit (3 jobs run)

edit 2:
à priori ça fonctionne.

Je ne comprend pas trop ce qui s'est passé. Tout s'est remis en marche.

Dernière modification par cleloup (Le 28/12/2013, à 10:44)