Pages : 1
#1 Le 11/10/2019, à 20:37
- katian
[RESOLU] cron & upgrade
Hello,
je compte mettre ce script (sous propriété root) :
#!/bin/sh
apt update && apt full-upgrade -y
à créer dans :
/etc/cron.hourly/
suis-je sur la bonne voie ? et je redirige la sortie comme ceci ? :
apt update && apt full-upgrade -y > /var/log/apt.hourly.log
Dernière modification par katian (Le 12/10/2019, à 02:11)
Hors ligne
#2 Le 11/10/2019, à 20:44
- Nuliel
Re : [RESOLU] cron & upgrade
Pourquoi ne le mets tu pas dans le crontab?
Hors ligne
#3 Le 11/10/2019, à 20:51
- katian
Re : [RESOLU] cron & upgrade
j'utilise déjà
/etc/cron.daily/
pour un reboot quotidien
j'ai à l'esprit qu'utiliser
/etc/cron.hourly/
pour une mise à jour est une bonne idée, autant que crontab
Hors ligne
#4 Le 11/10/2019, à 20:52
- Sciensous
Re : [RESOLU] cron & upgrade
déjà un problème: pourquoi toutes les heures ?
c'est beaucoup trop "court"
antiX 19 et 21 et Ubuntu 20.04 et 22.04
( sous LXDE et gnome-shell )
Hors ligne
#5 Le 11/10/2019, à 20:54
- Nuliel
Re : [RESOLU] cron & upgrade
Oui, ça revient au même, c'est juste que j'ai l'habitude d'utiliser le crontab en fait
Hors ligne
#6 Le 11/10/2019, à 21:29
- katian
Re : [RESOLU] cron & upgrade
ah tiens :
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Hors ligne
#7 Le 11/10/2019, à 21:40
- Nuliel
Re : [RESOLU] cron & upgrade
Oui c'est normal, apt n'aime pas qu'on redirige sa sortie, c'est pas fait pour apparemment. Vu que c'est juste pour enregistrer, je pense pas que ça dérange
Hors ligne
#8 Le 11/10/2019, à 21:45
- katian
Re : [RESOLU] cron & upgrade
merci Naziel ^^
je suppose que l'ordre de traitement de
/etc/cron.daily/
est tel qu'affiché ici ? :
/etc/cron.daily$ ll
total 52K
-rwxr-xr-x 1 root root 376 nov. 20 2017 apport*
-rwxr-xr-x 1 root root 1,5K avril 20 2018 apt-compat*
-rwxr-xr-x 1 root root 355 déc. 29 2017 bsdmainutils*
-rwxr-xr-x 1 root root 1,2K nov. 2 2017 dpkg*
-rwxr-xr-x 1 root root 372 août 21 2017 logrotate*
-rwxr-xr-x 1 root root 1,1K avril 7 2018 man-db*
-rwxr-xr-x 1 root root 539 juin 26 2018 mdadm*
-rwxr-xr-x 1 root root 538 mars 1 2018 mlocate*
-rwxr-xr-x 1 root root 249 janv. 25 2018 passwd*
-rwxr-xr-x 1 root root 3,4K févr. 21 2018 popularity-contest*
-rwxr-xr-x 1 root root 246 mars 21 2018 ubuntu-advantage-tools*
-rwxr-xr-x 1 root root 214 juin 27 2018 update-notifier-common*
-rwxr-xr-x 1 root root 49 août 7 02:49 zz-reboot*
zz-reboot est un ajout de ma part
Hors ligne
#9 Le 11/10/2019, à 21:54
- Watael
Re : [RESOLU] cron & upgrade
et aptcron ?
Connected \o/
Welcome to sHell. · eval is evil.
Hors ligne
#10 Le 11/10/2019, à 21:55
- katian
Re : [RESOLU] cron & upgrade
et aptcron ?
je vais étudier la question, je découvre
Hors ligne
#11 Le 11/10/2019, à 21:56
- Nuliel
Re : [RESOLU] cron & upgrade
Bonne question, à part que c'est run-parts qui les lance, je ne sais pas comment run-parts fonctionne. Mais l'ordre est donné par
run-parts --test /etc/cron.daily/
Hors ligne
#12 Le 14/10/2019, à 18:23
- katian
Re : [RESOLU] cron & upgrade
bon, confirmation que mon script dans
/etc/cron.hourly/
fonctionne, je consulte les mises à jour comme ceci
cat /var/log/apt/history.log
Hors ligne