3 # $DragonFly: src/bin/cpdup/scripts/do_cleanup,v 1.1 2006/09/16 21:57:10 dillon Exp $
7 if ( "$argv" == "" ) then
8 echo "./do_cleanup percentage"
15 set dcap = `df -i $cleaning_path | tail -1 | awk '{ print $5; }' | sed -e 's/%//'`
16 set icap = `df -i $cleaning_path | tail -1 | awk '{ print $8; }' | sed -e 's/%//'`
17 echo "space $dcap/$full inodes $icap/$full"
19 if ( $dcap < $full && $icap < $full ) then
23 foreach i ( ${backup_nfs}/* )
25 if ( ! -d $backup_nfs/$host ) then
28 set curbackup = `readlink $cleaning_path/mirrors/$host`
29 foreach item ( `ls -1da $cleaning_path/mirrors/$host.*` )
30 if ( ! -d $item ) then
33 if ( "${item:t}" == "$curbackup" ) then
37 # for safety, use a full path and do not rely on item's path
39 rm -rf $cleaning_path/mirrors/${item:t}
44 # let the fs catch up and update the df info
48 foreach benice ( 1 2 3 4 5 )