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 17/04/2015, à 11:22

abecidofugy

[Résolu] cron-apt : avoir les notifications du nbre de paquets à inst

Salut,

J'ai installé cron-apt, et mon mail ressemble à ça :

CRON-APT RUN [/etc/cron-apt/config]: Fri Apr 17 04:00:01 CEST 2015
CRON-APT SLEEP: 2804, Fri Apr 17 04:46:45 CEST 2015
CRON-APT ACTION: 3-download
CRON-APT LINE: /usr/bin/apt -o quiet=1 autoclean -y
E: Command line option 'y' [from -y] is not known.

D'abord, on dirait qu'il y a une erreur, ensuite, il n'est pas annoncé clairement le nombre de paquets pouvant être installé.

cat /etc/cron-apt/config
# Configuration for cron-apt. For further information about the possible
# configuration settings see /usr/share/doc/cron-apt/README.gz.

APTCOMMAND=/usr/bin/apt
MAILTO="nomemail@gmail.com"

Comment faire svp ?

Dernière modification par abecidofugy (Le 19/04/2015, à 04:45)

Hors ligne

#2 Le 17/04/2015, à 15:46

bruno

Re : [Résolu] cron-apt : avoir les notifications du nbre de paquets à inst

Bonjour,

Cette ligne :

APTCOMMAND=/usr/bin/apt

C'est toi qui l'a ajouté ? Qu'est-elle censée faire ?

Hors ligne

#3 Le 17/04/2015, à 16:17

mazarini

Re : [Résolu] cron-apt : avoir les notifications du nbre de paquets à inst

J'ai gardé un vieux fichier de config debian :

# Configuration for cron-apt.
# The cron config is located in /etc/cron.d/cron-apt
# This shows the defaults.
#

# The command used to execute all actions.  By default, apt-get is used.
# Change this to /usr/bin/aptitude to use aptitude instead, which will
# resolve changed Recommends (and Suggests as well, if aptitude is so
# configured). You can also set other utilities (especially useful in the
# config.d directory) so set some completely different tool.
# OBSERVE that this tool is indended for apt-get and tools like aptitude do not
# have full support for noninteractive upgrades. You may have to tune options
# to not create infinit logfiles for example.
# APTCOMMAND=/usr/bin/apt-get
# APTCOMMAND=/usr/bin/aptitude
# APTCOMMAND=/usr/bin/apt-file

# A path is needed for this to work. This is the default PATH.
# export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin

# The random sleep time in seconds. This is used to prevent clients from
# accessing the APT sources all at the same time and overwhelming them.
# Default is 3600 seconds which means one hour.
# RUNSLEEP=3600

# The minimum amount of disc space (in kB) that need to exist on the
# device where temporary files are created (mktemp) to allow cron-apt
# to run. If set to 0 it will always continue even if empty.
# MINTMPDIRSIZE=10

# The directory where the actions is stored.
# ACTIONDIR="/etc/cron-apt/action.d"

# The directory where configuration per action is stored. The message file
# must have the same name as the action file.
# ACTIONCONFDIR="/etc/cron-apt/config.d"

# The directory where messages that will be prepended to the email that is
# sent (per action) is stored. The message file must have the same name as
# the action file.
# MAILMSGDIR="/etc/cron-apt/mailmsg.d"

# The directory where messages that will be prepended to text that is
# sent (per action) to syslog. The message file must have the same name as
# the action file.
# SYSLOGMSGDIR="/etc/cron-apt/syslogmsg.d"

# The directory where messages that will be prepended to the error message
# (per action) is stored. The message file must have the same name as
# the action file.
# ERRORMSGDIR="/etc/cron-apt/errormsg.d"

# The directory where messages that will be prepended to the log (debug)
# message (per action) is stored. The message file must have the same name as
# the action file.
# LOGMSGDIR="/etc/cron-apt/logmsg.d"

# The directory where messages that will be prepended to the mail message
# (per MAILON type) is stored. The message file must have the same name as
# the $MAILON directive.
# MAILONMSGSDIR="/etc/cron-apt/mailonmsgs"

# The directory where messages that will be prepended to the syslog message
# (per SYSLOGON type) is stored. The message file must have the same name as
# the $SYSLOGON directive.
# SYSLOGONMSGSDIR="/etc/cron-apt/syslogonmsgs"

# Value: ""       (warn if dotlockfile not installed)
#        "nowarn" (don't give warning if dotlockfile not installed)
# NOLOCKWARN=""

# The file that contains error messages.
# ERROR="/var/log/cron-apt/error"

# The file that contains current run information
# when still running the script.
# TEMP="/var/log/cron-apt/temp"

# The logfile (for debugging). Use syslog for normal logging.
# LOG="/var/log/cron-apt/log"

# The mail file.
# MAIL="/var/log/cron-apt/mail"

# The email address to send mail to.
MAILTO="root"

# When to send email about the cron-apt results.
# Value: error   (send mail on error runs)
#	 upgrade (when packages are upgraded)
#	 changes (mail when change in output from an action)
#	 output  (send mail when output is generated)
#        always  (always send mail)
#                (else never send mail)
MAILON="upgrade"

# Value: error   (syslog on error runs)
#	 upgrade (when packages is upgraded)
#	 changes (syslog when change in output from an action)
#	 output  (syslog when output is generated)
#        always  (always syslog)
#                (else never syslog)
# SYSLOGON="upgrade"

# Value: error   (exit on error only)
#                (else never exit)
# EXITON="error"

# Value: verbose (log everything)
#        always  (always log)
#	 upgrade (when packages is upgraded)
#	 changes (log when change in output from an action)
#	 output  (log when output is generated)
#        error   (log error runs only)
#                (else log nothing)
# DEBUG="output"

# What to do with the diff when *ON=changes.
# Value: prepend (prepend to the output)
#        append  (append to the output)
#	 only	 (only show the diff, not the output itself)
#                (else do nothing)
# DIFFONCHANGES=prepend

# General apt options that will be passed to all APTCOMMAND calls.
# Use "-o quiet" instead of "-q" for aptitude compatibility.
#  OPTIONS="-o quiet=1"
# You can for example add an additional sources.list file here.
#  OPTIONS="-o quiet=1 -o Dir::Etc::SourceList=/etc/apt/security.sources.list"
# You can also set an alternative sources.list file here.
#  OPTIONS="-o quiet=1 -o Dir::Etc::SourceList=/etc/apt/security.sources.list -o Dir::Etc::SourceParts=\"/dev/null\""
# If you want to allow unauthenticated and untrusted packages add the
# following to your options directive.
#  OPTIONS="-o quiet=1 -o APT::Get::AllowUnauthenticated=true -o aptitude::Cmdline::ignore-trust-violations=yes"
# To limit the bandwidth used use the following line. This example limit the
# bandwidth usage to 25 kB/s.
#  OPTIONS="-o Acquire::http::Dl-Limit=25"

# additional APT configuration file that is loaded first. This can be set in
# order to use a completely different APT configuration for cron-apt. See the
# /usr/share/doc/cron-apt/README and apt.conf(5) for details
# export APT_CONFIG=/etc/apt/cron.apt.paths

# Do not run the command, if there is an error in the previous run (default).
# Value: error   (do not run if there is an error on last run)
#                (else always run, remove previous error file and run)
# DONTRUN=""

# If this file exist cron-apt will silently exit.
# REFRAINFILE=/etc/cron-apt/refrain

# If this is non-empty, it will be used as the host name in subjects of
# generated e-mail messages. If this is empty, the output of uname -n
# will be used.
HOSTNAME="MyHost"

# Ignore lines matching this regexp to determine whether changes occurred
# for MAILON="changes". If empty no lines will be ignored.
# Suggested value for aptitude:
#  DIFFIGNORE="^\(Get:[[:digit:]]\+\|Hit\|Ign\|Del\|Fetched\|Freed\|Reading\)[[:space:]]"

# Suggested value for apt-get:
#  DIFFIGNORE="^\(Get:[[:digit:]]\+\|Hit\|Ign\)[[:space:]]"
# Default:
#  DIFFIGNORE=""

# Support for mail headers. You can add up to 9 headers to the mail sent.
# This below example can be used for OTRS.
# The default is no headers added.
# XHEADER1="X-OTRS-Queue: updates"
# XHEADER2="X-OTRS-Loop: true"
# ...

# Umask for the files created by the APT command used. In all other cases
# umask 077 will be used.
# UMASK_APT="022"

S'il existait une école de la politique, les locaux devraient être édifiés rue de la Santé. Les élèves pourraient s'habituer. (Pierre Dac)

Hors ligne

#4 Le 17/04/2015, à 20:49

abecidofugy

Re : [Résolu] cron-apt : avoir les notifications du nbre de paquets à inst

@bruno : oui, il faut préciser si le système repose sur apt ou aptitude d'après ce que j'ai compris http://blog.pastoutafait.fr/billets/Mis … c-Cron-APT
J'ai rajouté la ligne, le fichier de conf était quasiment vide.

Je voudrais juste avoir un mail avec les paquets pouvant être upgradés lorsqu'ils se présentent, sans que la mise à jour ne se fasse.
Je précise aussi que j'ai mis : APTCOMMAND=/usr/bin/apt car avec APTCOMMAND=/usr/bin/apt-get je ne recevais pas le mail.

Hors ligne

#5 Le 17/04/2015, à 22:51

mazarini

Re : [Résolu] cron-apt : avoir les notifications du nbre de paquets à inst

Je soupçonne que le mail que tu reçois soit envoyé par cron et pas par cron-apt à cause des erreurs.

Pour l'envoi des mails :

# When to send email about the cron-apt results.
# Value: error   (send mail on error runs)
#	 upgrade (when packages are upgraded)
#	 changes (mail when change in output from an action)
#	 output  (send mail when output is generated)
#        always  (always send mail)
#                (else never send mail)
MAILON="upgrade"

Mets always pour tester.


S'il existait une école de la politique, les locaux devraient être édifiés rue de la Santé. Les élèves pourraient s'habituer. (Pierre Dac)

Hors ligne

#6 Le 18/04/2015, à 08:10

bruno

Re : [Résolu] cron-apt : avoir les notifications du nbre de paquets à inst

+1
L'erreur, clairement indiquée en #1, vient du fait que la commande apt ne prend pas en charge les options de la commande apt-get .
Tu as la doc dans /usr/share/doc/cron-apt/README. À lire…

Hors ligne

#7 Le 18/04/2015, à 08:38

abecidofugy

Re : [Résolu] cron-apt : avoir les notifications du nbre de paquets à inst

Ok, j'ai mis always et apt-get, on verra demain. Merci en attendant.

Hors ligne

#8 Le 18/04/2015, à 14:01

mazarini

Re : [Résolu] cron-apt : avoir les notifications du nbre de paquets à inst

Perso, je n'ai pas défini de commande :

# The command used to execute all actions.  By default, apt-get is used.
# Change this to /usr/bin/aptitude to use aptitude instead, which will
# resolve changed Recommends (and Suggests as well, if aptitude is so
# configured). You can also set other utilities (especially useful in the
# config.d directory) so set some completely different tool.
# OBSERVE that this tool is indended for apt-get and tools like aptitude do not
# have full support for noninteractive upgrades. You may have to tune options
# to not create infinit logfiles for example.
# APTCOMMAND=/usr/bin/apt-get
# APTCOMMAND=/usr/bin/aptitude
# APTCOMMAND=/usr/bin/apt-file

tu peux faire des tests avec la commande :

sudo /usr/sbin/cron-apt

S'il existait une école de la politique, les locaux devraient être édifiés rue de la Santé. Les élèves pourraient s'habituer. (Pierre Dac)

Hors ligne

#9 Le 19/04/2015, à 04:43

abecidofugy

Re : [Résolu] cron-apt : avoir les notifications du nbre de paquets à inst

CRON-APT RUN [/etc/cron-apt/config]: Sun Apr 19 04:00:01 CEST 2015
CRON-APT SLEEP: 1904, Sun Apr 19 04:31:45 CEST 2015
CRON-APT ACTION: 0-update
CRON-APT LINE: /usr/bin/apt-get -o quiet=1 update -o quiet=2
CRON-APT ACTION: 3-download
CRON-APT LINE: /usr/bin/apt-get -o quiet=1 autoclean -y
Reading package lists...
Building dependency tree...
Reading state information...
Del tzdata 2015b-0ubuntu0.14.04 [172 kB]
CRON-APT LINE: /usr/bin/apt-get -o quiet=1 dist-upgrade -d -y -o APT::Get::Show-Upgraded=true
Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be upgraded:
  tzdata
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 171 kB of archives.
After this operation, 8192 B disk space will be freed.
Get:1 http://security.ubuntu.com/ubuntu/ trusty-security/main tzdata all 2015c-0ubuntu0.14.04 [171 kB]
Fetched 171 kB in 0s (1410 kB/s)
Download complete and in download only mode

(y)

Hors ligne