From: Nikos Skalkotos Date: Sun, 11 Mar 2012 20:51:04 +0000 (+0200) Subject: Add mail and /var/tmp cleanup for unix systems X-Git-Tag: v0.1~139 X-Git-Url: https://code.grnet.gr/git/snf-image-creator/commitdiff_plain/9297c398a12757ffe1c7055564ec90047c77fa8e Add mail and /var/tmp cleanup for unix systems --- diff --git a/image_creator/os_type/unix.py b/image_creator/os_type/unix.py index e5e5a87..b7cde5d 100644 --- a/image_creator/os_type/unix.py +++ b/image_creator/os_type/unix.py @@ -36,13 +36,19 @@ class Unix(OSBase): self.cleanup_userdata() self.cleanup_tmp() self.cleanup_log() + self.cleanup_mail() def cleanup_tmp(self): self.foreach_file('/tmp', self.g.rm_rf, maxdepth=1) + self.foreach_file('/var/tmp', self.g.rm_rf, maxdepth=1) def cleanup_log(self): self.foreach_file('/var/log', self.g.truncate, ftype='r') + def cleanup_mail(self): + self.foreach_file('var/spool/mail', self.g.rm_rf, maxdepth=1) + self.foreach_file('var/mail', self.g.rm_rf, maxdepth=1) + def cleanup_userdata(self): homedirs = ['/root'] + self.ls('/home/')