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

  1. Newsgroups: comp.sys.next.sysadmin
  2. Path: sparky!uunet!trirex!root
  3. From: dglattin@trirex.com (Dennis Glatting)
  4. Subject: Re: Spaces in filenames
  5. Message-ID: <1992Aug17.135026.6618@Trirex.COM>
  6. Sender: root@Trirex.COM (Operator)
  7. Organization: Trirex Systems Inc.
  8. References: <1992Aug12.144727.17189@newstand.syr.edu>
  9. Date: Mon, 17 Aug 1992 13:50:26 GMT
  10. Lines: 67
  11.  
  12. In article <1992Aug12.144727.17189@newstand.syr.edu>  
  13. mcnichol@terminator.psy.syr.edu (Brendan T. McNichols) writes:
  14. > Hi all,
  15. > I have the following script which I modified from an earlier post by Jim  
  16. > Kiraly to search through the entire filesystem and delete all old files  
  17. > in .NextTrash directories.  
  18. > # ---  Empty the Recycler(s)   --- Changed by Brendan on August 10, 1992
  19. > # from an earlier version posted by Jim Kiraly to comp.sys.next.sysadmin 
  20. > #
  21. > # Search through entire filesystem looking for .NextTrash directories.
  22. > # Save the list in the variable trashlist. For every .NextTrash  
  23. directory 
  24. > # found in the previous command, find and delete all files that are more 
  25. > # than 1 day old.
  26. > trashlist=`find / -type d -name .NextTrash -prune -print`
  27. > for j in $trashlist 
  28. >   do
  29. >     echo 'Removing files more than 1 day old from recycler: '$j
  30. > #    find $j -ctime +1 -depth -exec rm -rf {};
  31. >   done
  32. > Unfortunatly, the script does not work if one of the paths in the  
  33. > trashlist variable has a space in it.  When the for loop gets to the  
  34. path  
  35. > with the space in it, it thinks that the path is actually two paths.   
  36. > Anyone know how I would go about fixing this problem?  Can anyone think  
  37. > of a better way of writing this script?
  38. > Thanks very much in advance,
  39. > Brendan
  40. > --
  41. > Brendan T. McNichols, Computer Support                (315) 443-9577
  42. > Psyracuse U. Sychology Dept.             mcnichol@psy.syr.edu (NeXT)
  43. > 430 Huntington Hall                                 mcnichol@syr.edu
  44. > Syracuse, NY 13244
  45.  
  46. I have written a script that 'cleans' hard disks but is more elaborate  
  47. then the one you posted.  Yes, it does handle spaces in the file names but  
  48. doesn't handle some of the special characters such as '?'.  I'm satisfied  
  49. with 95% for now but will eventually rewrite it in perl.
  50.  
  51. This script not only processes .NextTrash but cleans things like  
  52. uucppublic, uucp, /tmp, and backup files.
  53.  
  54. The script is copyrighted but I can send it to you as a beta test site.   
  55. Feedback will be required.  The 'clean' script is but one of a suite of  
  56. sysadmin scripts I have written.  Some of the others include:  one that  
  57. cruses through all of the NetInfo domains listing the domains and/or hosts  
  58. under those domains -- useful for multi level domain structures (here at  
  59. Trirex we have a four level);  another gathers all of the passwd entries  
  60. from all of the domains and hosts and submits them to Crack.
  61.  
  62. We're considering marketing those scripts.  They cost money to develop.   
  63. On the other hand, we might dump them into the public domain for education  
  64. institution use only.  Decisions, decisions...
  65.  
  66.  
  67. --
  68. Dennis P. Glatting
  69. Sr. Technical Manager
  70. Trirex Systems Inc.
  71. 315 Post Road West
  72. Westport, Connecticut   06880
  73. 203-221-4614
  74.