]> git.nbdom.net Git - nb.git/commitdiff
etc/cron.weekly/clean-dirs
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 24 Feb 2019 03:04:19 +0000 (03:04 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sun, 24 Feb 2019 03:04:19 +0000 (03:04 +0000)
etc/cron.weekly/clean-dirs
etc/profile.d/sys.sh

index cb2af863500caa34adf8b98a3e1c86022450f15f..b94ea4fb04597439ad06c315f8fc95f029e6e749 100755 (executable)
@@ -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
 
index b0f8ff35e858e446e464f8252e48a96cbcec8d36..fd017266a03afec95cb9280e9d43fd6c81b4299a 100644 (file)
@@ -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'
 }