View | Details | Raw Unified | Return to bug 129697 | Differences between
and this patch

Collapse All | Expand All

(-)progs/100.clean-disks (-5 / +13 lines)
Lines 29-38 Link Here
29
	    echo ""
29
	    echo ""
30
	    echo "Cleaning disks:"
30
	    echo "Cleaning disks:"
31
	    set -f noglob
31
	    set -f noglob
32
	    args="$args -name "`echo "$daily_clean_disks_files" |
32
	    args="$args ( -name "`echo "$daily_clean_disks_files" |
33
		sed -e 's/^[ 	]*//' \
33
		sed -e 's/^[ 	]*//' \
34
		    -e 's/[ 	]*$//' \
34
		    -e 's/[ 	]*$//' \
35
		    -e 's/[ 	][ 	]*/ -o -name /g'`
35
		    -e 's/[ 	][ 	]*/ -o -name /g'`" )"
36
37
	    if ! [ -z "$daily_clean_disks_ignore" ]
38
		then
39
			args="$args -a ! ( -name "`echo "$daily_clean_disks_ignore" |
40
			sed -e 's/^[ 	]*//' \
41
				-e 's/[ 	]*$//' \
42
				-e 's/[ 	][ 	]*/ -o -name /g'`" )"
43
		fi
36
44
37
	    case "$daily_clean_disks_verbose" in
45
	    case "$daily_clean_disks_verbose" in
38
		[Yy][Ee][Ss])
46
		[Yy][Ee][Ss])
Lines 41-49 Link Here
41
		    print=;;
49
		    print=;;
42
	    esac
50
	    esac
43
51
44
	    rc=$(find / \( ! -fstype local -o -fstype rdonly \) -a -prune -o \
52
	    command="find / ( ! -fstype local -o -fstype rdonly ) -a -prune -o \
45
		\( $args \) -atime +$daily_clean_disks_days -delete $print |
53
		( $args ) -atime +$daily_clean_disks_days -delete $print "
46
		tee /dev/stderr | wc -l)
54
	    rc=$($command | tee /dev/stderr | wc -l)
47
	    [ -z "$print" ] && rc=0
55
	    [ -z "$print" ] && rc=0
48
	    [ $rc -gt 1 ] && rc=1
56
	    [ $rc -gt 1 ] && rc=1
49
	    set -f glob
57
	    set -f glob

Return to bug 129697