home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / next / sysadmin / 4632 < prev    next >
Encoding:
Text File  |  1992-08-12  |  1.7 KB  |  44 lines

  1. Newsgroups: comp.sys.next.sysadmin
  2. From: mcnichol@terminator.psy.syr.edu (Brendan T. McNichols)
  3. Subject: Spaces in filenames
  4. Message-ID: <1992Aug12.144727.17189@newstand.syr.edu>
  5. Reply-To: mcnichol@mailbox.syr.edu
  6. Path: sparky!uunet!psinntp!newstand.syr.edu!mcnichol@terminator.psy.syr.edu
  7. Date: Wed, 12 Aug 92 14:47:27 EDT
  8. Lines: 34
  9.  
  10. Hi all,
  11.  
  12. I have the following script which I modified from an earlier post by Jim  
  13. Kiraly to search through the entire filesystem and delete all old files  
  14. in .NextTrash directories.  
  15.  
  16. # ---  Empty the Recycler(s)   --- Changed by Brendan on August 10, 1992
  17. # from an earlier version posted by Jim Kiraly to comp.sys.next.sysadmin 
  18. #
  19. # Search through entire filesystem looking for .NextTrash directories.
  20. # Save the list in the variable trashlist. For every .NextTrash directory 
  21. # found in the previous command, find and delete all files that are more 
  22. # than 1 day old.
  23. trashlist=`find / -type d -name .NextTrash -prune -print`
  24. for j in $trashlist 
  25.   do
  26.     echo 'Removing files more than 1 day old from recycler: '$j
  27. #    find $j -ctime +1 -depth -exec rm -rf {};
  28.   done
  29.  
  30. Unfortunatly, the script does not work if one of the paths in the  
  31. trashlist variable has a space in it.  When the for loop gets to the path  
  32. with the space in it, it thinks that the path is actually two paths.   
  33. Anyone know how I would go about fixing this problem?  Can anyone think  
  34. of a better way of writing this script?
  35.  
  36. Thanks very much in advance,
  37. Brendan
  38.  
  39. --
  40. Brendan T. McNichols, Computer Support                (315) 443-9577
  41. Psyracuse U. Sychology Dept.             mcnichol@psy.syr.edu (NeXT)
  42. 430 Huntington Hall                                 mcnichol@syr.edu
  43. Syracuse, NY 13244
  44.