Missing Link

Secure Delete Automator Workflow

by John on Dec.07, 2009, under Personal

AutomatorWhat do you do when you’re finished with a document on your computer and need or want to get rid of it?   For most people the answer is to delete the file.  That is, after all, the most logical thing to do, right?   What a lot of people fail to realize is that simply deleting a file does NOT remove it from your hard drive.  A person skilled in data recovery can easily recover that data unless it has been overwritten several times.  Deleting the file only removes references to the file from the filesystem.  It does not physically remove the data from the drive, however, instead it just allows the computer to overwrite the space where it had been stored.

There are, however, ways you can securely delete files from your computer.  These tools will overwrite the space on the hard drive where the file resided,  usually 7 or more times (and often the number of passes is configurable).  This morning my boss brought to my attention the fact that one such utility is available by default on Mac OS X 10.6 (Snow Leopard).   The command, srm, is used via the command line and will securely remove your files.

David (my boss) helpfully created an automator workflow, however, which when saved as a service on your machine will add an option to the right-click context menu in Finder that allows you to securely delete the file.

I – being in a sharing mood – have shared this automator workflow HERE for your enjoyment.

A few notes:   In the actual shell command – pay attention to the switches after srm.  Specifically, you may want to change the s in “-rsf” to an m ( so -rmf).  The s will do a single pass at overwriting the file, while m will do a full 7 passes.

This is provided as-is, though I will answer any questions I’m able to.   As always – use at your own risk, if it breaks your stuff that’s not my fault.

Special thanks to David Meade for providing the automator workflow.

[Update:  I forgot to mention that you can also securely delete files by moving them to your trash folder, and selecting "Secure Empty Trash" from the finder menu...]

[Update 2:  A friend of mine has pointed out that you can set it up so that Finder uses srm to securely empty the trash by default, to do this go the the Finder menu -> preferences -> advanced, and check the box for Empty Trash securely. Enjoy]

:, , , , , , ,

2 Comments for this entry

  • David Meade

    Securely emptying the trash, as your friend mentioned, is a great feature, but for me I typically am not deleting confidential data (it’s usually just downloaded installers, old notes to self, and other non-sensitive data) … a secure delete / ‘wipe’ of these sorts of things are usually overkill and not worth the performance hit.

    Also, my trash usually fills up with LOTS of files before I get around to emptying it.

    Since my trash usually has LOTS of (non-sensitive) files in it, and since a secure delete takes longer than a normal delete … I’d usually rather not take the time to securely delete the 3,457 files in my trash when in fact it was only the one file that I really cared to have ’securely deleted’.

    Using srm (via a finder service) lets you securely delete a group of selected files and still use the faster (and recoverable) “normal delete” for the scores of non-confidential files that may be in your trash. :)

    (BTW, thanks for the shout out, but it was mostly the all powerful Google that led me to the solution that others had figured out before :)

    • John

      Definitely valid arguments Dave – which is why I posted this in the first place. For times when you just want a quick and easy way to remove a few files this finder service really does the job well.

      Additionally, you can choose (with this finder service) how many passes you want – a single pass, DoD Spec 7 passes, or 32 passes. I know of no EASY way of setting that in Finder for it’s securely empty trash.

      (I, btw, use 7 passes.)

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!