I'm trying to automatize the updates of debian system, without making upgrades. Then i'll send an e-mail to me, everytime there is an upgrade available.I've tryied to do it with cron-apt, but i really don't like how the configuration is organized, that's why i would prefer using a (cleaner) cron job that launch the script.looking around i found that piece of code (not mein) :if [[ `apt-get update 2>&1 | grep Get` ]]; then  if [[ `apt-get --simulate dist-upgrade 2>&1 | grep Inst` ]]; then    apt-get --simulate dist-upgrade  fifiFrom what i can understand(im a little-bit noob), that script update the local packages list, and make a simulation of an eventual upgrade.Now if it's possible i would like to send to me via email the output of the update, and of the upgrade-simulation. For acheave that i could use mail command:sending first email:apt-get update | mail -s daily update report me@example.comsecond email:apt-get --simulate dist-upgrade | mail -s daily upgrade-simulation report me@example.comMy main question is if there a better approach to do all this..? Secondarely, I've tryied without succed to send everything in just one email, anybody know how i could do it?
automate updates with a bash script and cron
debian;email;cron;upgrade
Don't reinvent the wheel.apt-get install apticronApticron is a simple script which sends daily emails about pending package updates such as security updates, properly handling packages on hold both by dselect and aptitude.