# Envoyer les messages debug a root par mail

**URL:** <https://www.debian-fr.org/t/envoyer-les-messages-debug-a-root-par-mail/73749>\
**Category:** Programmation\
**Created:** [Juin 22, 2017, 6:50 UTC](https://www.debian-fr.org/t/envoyer-les-messages-debug-a-root-par-mail/73749 "2017-06-22T06:50:20Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![grandtoubab](https://www.debian-fr.org/user_avatar/www.debian-fr.org/grandtoubab/32/4505_2.png) [@grandtoubab](https://www.debian-fr.org/u/grandtoubab)\
**Post date:** [Juin 22, 2017, 8:38 UTC](https://www.debian-fr.org/t/envoyer-les-messages-debug-a-root-par-mail/73749/5 "2017-06-22T20:38:22Z")

</div>

petite gâterie 😀

Pour avoir la liste des paquets pouvant être mis à jour dans le mail, jai modifié la partie update package lists

```auto
    # update package lists
    UPDATED=0
    UPDATE_STAMP=/var/lib/apt/periodic/update-stamp
    if check_stamp $UPDATE_STAMP $UpdateInterval; then
	if eval apt-get $XAPTOPT -y update $XSTDERR; then
	    debug_echo "download updated metadata (success)."
	    if which dbus-send >/dev/null 2>&1 && pidof dbus-daemon >/dev/null 2>&1; then
		if dbus-send --system / app.apt.dbus.updated boolean:true ; then
		    debug_echo "send dbus signal (success)"
		else
		    debug_echo "send dbus signal (error)"
		fi
	    else
		debug_echo "dbus signal not send (command not available)"
	    fi
	    update_stamp $UPDATE_STAMP
	    UPDATED=1
	    echo ' *************************************' >> "/tmp/resul-apt-daily.txt"
	    apt list --upgradable >> "/tmp/resul-apt-daily.txt"	
            echo ' *************************************' >> "/tmp/resul-apt-daily.txt"
	else
	    debug_echo "download updated metadata (error)"
	fi
    else
	debug_echo "download updated metadata (not run)."
    fi

```

[![](https://www.debian-fr.org/uploads/default/original/2X/d/d5f5e6ee3ac0a699b235875197fa26619ae64362.png)](http://pix.toile-libre.org/?img=1498164650.png)

---

_[View the full topic](https://www.debian-fr.org/t/envoyer-les-messages-debug-a-root-par-mail/73749)._
