This script will upgrade running Debian system and email the result: what was upgraded, from what version to what and for what period of time. The actual upgrade will be done only if all index files will be successfully updated, all required packages will be successfully downloaded, and finally only if the simulating of upgrade will be finished without errors. All old configuration files are preserved and can be compared with new *.dpkg-dist files. It is intended to be used as cron job.
It is working for years, keeping system up-to-date always. When recent upgrade bring unwanted results, You can analyze upgrade report to found out what packages caused the problems and then do rollback to stable state as old packages are preserved before next upgrade.