slitaz-pizza rev 18

pizza: log purge
author Christophe Lincoln <pankso@slitaz.org>
date Mon Mar 26 14:58:17 2012 +0200 (2012-03-26)
parents a6b8d65c19a2
children dd5f9f1bdcb2
files pizza
line diff
     1.1 --- a/pizza	Mon Mar 26 14:50:51 2012 +0200
     1.2 +++ b/pizza	Mon Mar 26 14:58:17 2012 +0200
     1.3 @@ -75,6 +75,12 @@
     1.4  	grep ^MAIL_SERVER /etc/slitaz/pizza.conf >> $config
     1.5  }
     1.6  
     1.7 +# Log activities, we want first letter capitalized.
     1.8 +log() {
     1.9 +	grep ^[A-Z] | \
    1.10 +		sed s"#^[A-Z]\([^']*\)#$(date '+%Y-%m-%d %H:%M') : \0#" >> $activity
    1.11 +}
    1.12 +
    1.13  #
    1.14  # Commands
    1.15  #
    1.16 @@ -193,6 +199,7 @@
    1.17  	purge)
    1.18  		# Remove tmp file older than 24 hours and ISO older than 15 days.
    1.19  		# TODO: Improve and use configs from pizza.conf
    1.20 +		echo "Purging temporary files and old flavors" | log
    1.21  		echo "Purging tmp files..."
    1.22  		find $tmp -mtime +1 | xargs rm -f
    1.23  		echo "Purging ISO's..."