usched: Allow process to change self cpu affinity
[dragonfly.git] / etc / periodic / daily / 100.clean-disks
blob78fd80f968c65a175c2b260752e66572657a43c1
1 #!/bin/sh
3 # $FreeBSD: src/etc/periodic/daily/100.clean-disks,v 1.3.2.6 2001/04/25 12:13:12 ru Exp $
4 # $DragonFly: src/etc/periodic/daily/100.clean-disks,v 1.2 2003/06/17 04:24:48 dillon Exp $
6 # Remove garbage files more than $daily_clean_disks_days days old
9 # If there is a global system configuration file, suck it in.
11 if [ -r /etc/defaults/periodic.conf ]
12 then
13 . /etc/defaults/periodic.conf
14 source_periodic_confs
17 case "$daily_clean_disks_enable" in
18 [Yy][Ee][Ss])
19 if [ -z "$daily_clean_disks_days" ]
20 then
21 echo '$daily_clean_disks_enable is set but' \
22 '$daily_clean_disks_days is not'
23 rc=2
24 elif [ -z "$daily_clean_disks_files" ]
25 then
26 echo '$daily_clean_disks_enable is set but' \
27 '$daily_clean_disks_files is not'
28 rc=2
29 else
30 echo ""
31 echo "Cleaning disks:"
32 set -f noglob
33 args="$args -name "`echo "$daily_clean_disks_files" |
34 sed -e 's/^[ ]*//' \
35 -e 's/[ ]*$//' \
36 -e 's/[ ][ ]*/ -o -name /g'`
38 case "$daily_clean_disks_verbose" in
39 [Yy][Ee][Ss])
40 print=-print;;
42 print=;;
43 esac
45 rc=$(find / \( ! -fstype local -o -fstype rdonly \) -a -prune -o \
46 \( $args \) -atime +$daily_clean_disks_days -delete $print |
47 tee /dev/stderr | wc -l)
48 [ -z "$print" ] && rc=0
49 [ $rc -gt 1 ] && rc=1
50 set -f glob
51 fi;;
53 *) rc=0;;
54 esac
56 exit $rc