#1 Le 02/11/2016, à 12:24
- hazertyck
à quel moment s'executent les scripts dans /etc/cron.monthly/
Bonjour,
Question idiotte, mais j'ai mis un script dans /etc/cron.monthly/ en fin de mois dernier, et je pensait naivement que monthly allait le lancer tous les premier ( ou dernier) jours du mois, or nous avons passé le 31 et le 1er et mon script n'a pas été exécuté. D'où ma question : tous les mois, mais quand ?
J'ai regardé la doc ici mais je ne comprends pas le sens de :
@monthly 15 cron.monthly nice run-parts --report /etc/cron.monthly
une indication ?
Merci
Hors ligne
#2 Le 02/11/2016, à 13:37
- grandtoubab
Re : à quel moment s'executent les scripts dans /etc/cron.monthly/
Salut,
- monthly: lancement une fois par mois
- 15: la tâche est exécutée 15 mn après le démarrage du système
Regarder la date du dernier lancement
ls -alrt /var/spool/anacron
exemple
ls -alrt /var/spool/anacron
total 20
drwxr-xr-x 8 root root 4096 mai 25 11:08 ..
drwxr-xr-x 2 root root 4096 mai 25 11:08 .
-rw------- 1 root root 9 oct. 23 08:14 cron.monthly
-rw------- 1 root root 9 nov. 2 08:59 cron.daily
-rw------- 1 root root 9 nov. 2 08:59 cron.weekly
cron.monthly à été lancé le 23 octobre à 8h14
Pour forcer un lancement
sudo anacron -f -n
messages dans /var/log/syslog
Nov 2 14:08:00 debian anacron[4357]: Anacron 2.3 started on 2016-11-02
Nov 2 14:08:00 debian systemd[1]: Starting Laptop Mode Tools - Battery Polling Service...
Nov 2 14:08:00 debian anacron[4357]: Will run job `cron.daily'
Nov 2 14:08:00 debian anacron[4357]: Will run job `cron.weekly'
Nov 2 14:08:00 debian anacron[4357]: Will run job `cron.monthly'
Nov 2 14:08:00 debian anacron[4357]: Jobs will be executed sequentially
Nov 2 14:08:00 debian anacron[4357]: Job `cron.daily' started
Nov 2 14:12:13 debian anacron[4357]: Job `cron.daily' terminated (mailing output)
Nov 2 14:12:13 debian anacron[4357]: Job `cron.weekly' started
Nov 2 14:12:13 debian anacron[5262]: Updated timestamp for job `cron.weekly' to 2016-11-02
Nov 2 14:12:16 debian anacron[4357]: Job `cron.weekly' terminated
Nov 2 14:12:16 debian anacron[4357]: Job `cron.monthly' started
Nov 2 14:12:16 debian anacron[4357]: Job `cron.monthly' terminated
Nov 2 14:12:16 debian anacron[4357]: Normal exit (3 jobs run)
Nov 2 14:12:16 debian anacron[5273]: Updated timestamp for job `cron.monthly' to 2016-11-02
ls -alrt /var/spool/anacron
total 20
drwxr-xr-x 8 root root 4096 mai 25 11:08 ..
drwxr-xr-x 2 root root 4096 mai 25 11:08 .
-rw------- 1 root root 9 nov. 2 14:12 cron.daily
-rw------- 1 root root 9 nov. 2 14:12 cron.weekly
-rw------- 1 root root 9 nov. 2 14:12 cron.monthly
Référence http://www.linuxdevcenter.com/cmd/cmd.c … =a/anacron
Dernière modification par grandtoubab (Le 02/11/2016, à 14:19)
Linux tout seul sur HP Pavilion DV7 et Acer Aspire T650, Canon MG3650 en wifi
Debian 11 Bullseye Gnome/Xorg, Gnome/Wayland avec SDDM
https://bidouilledebian.wordpress.com/
ON M'A VU DANS LE VERCORS, SAUTER A L'ELASTIQUE..... J'AI DANS LES BOTTES DES MONTAGNES DE QUESTIONS....
Hors ligne