From: Nicolas Boisselier Date: Sun, 24 Feb 2019 03:04:19 +0000 (+0000) Subject: etc/cron.weekly/clean-dirs X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=01ca4eb48c63d2339ed8b0de78e17a6627c868b1;p=nb.git etc/cron.weekly/clean-dirs --- diff --git a/etc/cron.weekly/clean-dirs b/etc/cron.weekly/clean-dirs index cb2af863..b94ea4fb 100755 --- a/etc/cron.weekly/clean-dirs +++ b/etc/cron.weekly/clean-dirs @@ -7,7 +7,7 @@ # To test: touch -t '190001010000' /tmp/todel && ls -lh /tmp/todel # ################################################################################# -DAYS="+90" +DAYS="90" DIRS="\ /tmp/ \ /var/tmp/ \ @@ -69,8 +69,8 @@ fi ( [ -n "$LOCATE" ] && which locate 1>/dev/null 2>&1 && locate $LOCATE & if [ -n "$DIRS" -a -n "$DAYS" ]; then - eval find $DIRS -mindepth 1 -not -type d -mtime $DAYS - eval find $DIRS -mindepth 1 -type d -mtime $DAYS -empty -prune + eval find $DIRS -mindepth 1 -not -type d -mtime +$DAYS + eval find $DIRS -mindepth 1 -type d -mtime +$DAYS -empty -prune fi ) 2>/dev/null | while IFS= read -r path; do diff --git a/etc/profile.d/sys.sh b/etc/profile.d/sys.sh index b0f8ff35..fd017266 100644 --- a/etc/profile.d/sys.sh +++ b/etc/profile.d/sys.sh @@ -182,7 +182,8 @@ sys_cpu_load() { ; } -sys_cpu_temp() { - local temp=$(cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null) +sys_cpu_temperature() { + temp=$(head -1 /sys/class/thermal/thermal_zone*/temp 2>/dev/null) [ -n "$temp" ] && echo $(($temp/1000)) + type -P vcgencmd > /dev/null && vcgencmd measure_temp | sed -E -e 's/^.*=([0-9\.]+).*$/\1/g' }