summaryrefslogtreecommitdiff
path: root/debian/apt.cron.daily
diff options
context:
space:
mode:
authorMatt Zimmerman <matt.zimmerman@canonical.com>2004-11-23 20:52:13 +0000
committerMatt Zimmerman <matt.zimmerman@canonical.com>2004-11-23 20:52:13 +0000
commit9bd1cf874fd4ec2f67e0cb1a0af1c894b10f1d14 (patch)
tree26b800a3d445982754e93cf6ae44c9396059aa10 /debian/apt.cron.daily
parent7beaa7838d8b29a65ec5fe3b2a175dffafbb4a03 (diff)
Add APT::Periodic::Autoclean setting
* Add APT::Periodic::Autoclean setting, to allow "apt-get autoclean" to be run periodically. This is useful with APT::Periodic::Download-Upgradeable-Packages, and defaults to the same value, so that the cache size is bounded
Diffstat (limited to 'debian/apt.cron.daily')
-rw-r--r--debian/apt.cron.daily11
1 files changed, 9 insertions, 2 deletions
diff --git a/debian/apt.cron.daily b/debian/apt.cron.daily
index bb6c0151e..17fe8fb78 100644
--- a/debian/apt.cron.daily
+++ b/debian/apt.cron.daily
@@ -38,8 +38,9 @@ update_stamp()
UpdateInterval=0
DownloadUpgradeableInterval=0
-RES=`apt-config shell UpdateInterval APT::Periodic::Update-Package-Lists DownloadUpgradeableInterval APT::Periodic::Download-Upgradeable-Packages`
-eval $RES
+eval $(apt-config shell UpdateInterval APT::Periodic::Update-Package-Lists DownloadUpgradeableInterval APT::Periodic::Download-Upgradeable-Packages)
+AutocleanInterval=$DownloadUpgradeableInterval
+eval $(apt-config shell AutocleanInterval APT::Periodic::Autoclean)
# laptop check, on_ac_power returns:
# 0 (true) System is on mains power
@@ -68,3 +69,9 @@ if check_stamp $DOWNLOAD_UPGRADEABLE_STAMP $DownloadUpgradeableInterval; then
apt-get -qq -d dist-upgrade 2>/dev/null
update_stamp $DOWNLOAD_UPGRADEABLE_STAMP
fi
+
+AUTOCLEAN_STAMP=/var/lib/apt/periodic/autoclean-stamp
+if check_stamp $AUTOCLEAN_STAMP $AutocleanInterval; then
+ apt-get -qq autoclean
+ update_stamp $AUTOCLEAN_STAMP
+fi