
Name, version and their timestamp are returned in chronological order.ĭuplicates are removed using the latest entry. Output_file = '/var/log/manually_installed_software_%s' % hostname Initial_status = '/var/log/installer/initial-status.gz' Tmpdir = '/tmp/dpkg_logfiles' # This must be a transient directory # Note that the % character is interpreted by crontab as newline so it must be escaped as \%ġ 1 1 * * root python /etc/system_administration/statistics/list_manually_installed_packages.py `date -date='last month' +'\%Y\%m\%d'` > /var/log/list_packages.log 2>&1įrom time import strftime, strptime, mktime, ctime, localtime, time as gettime # Make monthly list of manually installed software This script can be used in a crontab to list software installed every month. Python list_manually_installed_packages.py `date -date='last month' +'%Y%m%d'` Python list_manually_installed_packages.py 20100201 The date format is YYYYMMDD and be used e.g. Optional argument will list only packages installed since that date. Output results to /var/log/manually_installed_software_.csv Python list_manually_installed_packages.py """List manually installed debian packages
