SCIENTIFIC-LINUX-USERS Archives

November 2006

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Kenneth A. Schumacher" <[log in to unmask]>
Reply To:
Kenneth A. Schumacher
Date:
Tue, 21 Nov 2006 10:52:31 -0600
Content-Type:
multipart/signed
Parts/Attachments:
text/plain (1510 bytes) , smime.p7s (4 kB)
Robert,

One other suggestion.

FRANCHISSEUR Robert wrote:
> This is what I did (as root):
> 
> cd /mirror_disk/sauvegarde/data
> time find . -exec shred -n 3 -z -u  {} \;
> 
> on a directory of ~ 14 Gb in a 1 Tb firewire external disk
> mounted on /mirror_disk/
> 
> The command did what I expected but I discovered that several 
> other files in other partitions were *EMPTIED* !!!
> 
> For example, among others:
> 
> cd /; find . -type f -size 0  -printf " %t %s " -print

Rather than use the dot (.) for specifying where you what find to start 
working from, spell out the directory where you want it to start.  This 
is especially true when running a command that removes files/data and 
running as 'root'.

Imagine if I type:

cd /afs/fnal.gov/<some_unreachable_directory>; find . { and then the 
rest of the command.

If the directory that I tried to CD into is not accessible for any 
reason, that 'cd' command will fail.  Then the 'find' command will start 
running from whatever directory I am currently in.  This can be a very 
bad thing.  Everyone makes that mistake once in their life.  You have 
been warned. :-)

Also, there is an option on the find command which will limit the files 
found to the filesystem where you begin your search.  While this is 
quite useful, I don't know if it will help with the 'shred' command.  As 
someone else pointed out, it appears that 'shred' followed some links 
and did it's clean-up work.  Using the option that limits the scope of 
the find will not place any limits on the scope of 'shred'.

Ken S.


ATOM RSS1 RSS2