Article View: comp.sys.next.sysadmin
Article #838Re: Spaces in filenames
From: Dennis Glatting
Date: Mon, 17 Aug 1992 13:50
Date: Mon, 17 Aug 1992 13:50
67 lines
3238 bytes
3238 bytes
In article <1992Aug12.144727.17189@newstand.syr.edu>
mcnichol@terminator.psy.syr.edu (Brendan T. McNichols) writes:
> Hi all,
>
> I have the following script which I modified from an earlier post by Jim
> Kiraly to search through the entire filesystem and delete all old files
> in .NextTrash directories.
>
> # --- Empty the Recycler(s) --- Changed by Brendan on August 10, 1992
> # from an earlier version posted by Jim Kiraly to comp.sys.next.sysadmin
> #
> # Search through entire filesystem looking for .NextTrash directories.
> # Save the list in the variable trashlist. For every .NextTrash
directory
> # found in the previous command, find and delete all files that are more
> # than 1 day old.
> trashlist=`find / -type d -name .NextTrash -prune -print`
> for j in $trashlist
> do
> echo 'Removing files more than 1 day old from recycler: '$j
> # find $j -ctime +1 -depth -exec rm -rf {};
> done
>
> Unfortunatly, the script does not work if one of the paths in the
> trashlist variable has a space in it. When the for loop gets to the
path
> with the space in it, it thinks that the path is actually two paths.
> Anyone know how I would go about fixing this problem? Can anyone think
> of a better way of writing this script?
>
> Thanks very much in advance,
> Brendan
>
> --
> Brendan T. McNichols, Computer Support (315) 443-9577
> Psyracuse U. Sychology Dept. mcnichol@psy.syr.edu (NeXT)
> 430 Huntington Hall mcnichol@syr.edu
> Syracuse, NY 13244
I have written a script that 'cleans' hard disks but is more elaborate
then the one you posted. Yes, it does handle spaces in the file names but
doesn't handle some of the special characters such as '?'. I'm satisfied
with 95% for now but will eventually rewrite it in perl.
This script not only processes .NextTrash but cleans things like
uucppublic, uucp, /tmp, and backup files.
The script is copyrighted but I can send it to you as a beta test site.
Feedback will be required. The 'clean' script is but one of a suite of
sysadmin scripts I have written. Some of the others include: one that
cruses through all of the NetInfo domains listing the domains and/or hosts
under those domains -- useful for multi level domain structures (here at
Trirex we have a four level); another gathers all of the passwd entries
from all of the domains and hosts and submits them to Crack.
We're considering marketing those scripts. They cost money to develop.
On the other hand, we might dump them into the public domain for education
institution use only. Decisions, decisions...
--
Dennis P. Glatting
Sr. Technical Manager
Trirex Systems Inc.
315 Post Road West
Westport, Connecticut 06880
203-221-4614
Technical Details
Message-ID:
<1992Aug17.135026.6618@Trirex.COM>Path:
arc1-ca.pugleaf.net!sparky!uunet!trirex!rootReferences:
<1992Aug12.144727.17189@newstand.syr.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.sysadmin Path: arc1-ca.pugleaf.net!sparky!uunet!trirex!root From: dglattin@trirex.com (Dennis Glatting) Subject: Re: Spaces in filenames Message-ID: <1992Aug17.135026.6618@Trirex.COM> Sender: root@Trirex.COM (Operator) Organization: Trirex Systems Inc. References: <1992Aug12.144727.17189@newstand.syr.edu> Date: Mon, 17 Aug 1992 13:50:26 GMT Lines: 67