aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorOlivier Blin <blino@mageia.org>2011-06-06 21:24:12 +0000
committerOlivier Blin <blino@mageia.org>2011-06-06 21:24:12 +0000
commiteb9146714560161a06f8b241c16d7254a4fa1299 (patch)
treecccabc4fc12be63679cfcd23f97da3afb47e4e3f /modules
parent695a6738da1754b67974be11d26cab086a377674 (diff)
downloadpuppet-eb9146714560161a06f8b241c16d7254a4fa1299.tar
puppet-eb9146714560161a06f8b241c16d7254a4fa1299.tar.gz
puppet-eb9146714560161a06f8b241c16d7254a4fa1299.tar.bz2
puppet-eb9146714560161a06f8b241c16d7254a4fa1299.tar.xz
puppet-eb9146714560161a06f8b241c16d7254a4fa1299.zip
add script and cron to clean live build data
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/draklive/files/clean-live.sh13
-rw-r--r--modules/draklive/manifests/init.pp14
2 files changed, 27 insertions, 0 deletions
diff --git a/modules/draklive/files/clean-live.sh b/modules/draklive/files/clean-live.sh
new file mode 100755
index 00000000..1e6ce7d7
--- /dev/null
+++ b/modules/draklive/files/clean-live.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# clean old draklive build sets
+DRAKLIVE_ROOT=/var/lib/draklive
+RM="echo rm -rf"
+
+# keep only chroot/build sets from previous day
+MAX_BUILD_AGE=1
+find $DRAKLIVE_ROOT/{chroot/*,build/*/*} -maxdepth 0 -not -name dist -mtime +$(expr $MAX_BUILD_AGE - 1) -exec $RM {} \;
+
+# keep dist (iso + lists) for all sets during 20 days
+MAX_DIST_AGE=20
+find $DRAKLIVE_ROOT/build/*/dist -maxdepth 0 -mtime +$(expr $MAX_DIST_AGE - 1) -exec $RM {} \;
diff --git a/modules/draklive/manifests/init.pp b/modules/draklive/manifests/init.pp
index 3ba24d87..0f643bb4 100644
--- a/modules/draklive/manifests/init.pp
+++ b/modules/draklive/manifests/init.pp
@@ -45,5 +45,19 @@ class draklive {
hour => "4",
minute => "30",
}
+
+ file { "/usr/local/bin/clean-live.sh":
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 755,
+ source => "puppet:///modules/draklive/clean-live.sh",
+ }
+
+ cron { "clean live build data":
+ command => "/usr/local/bin/clean-live.sh",
+ hour => "4",
+ minute => "20",
+ }
}
}